F
F
fokin_nikolay19892018-06-29 15:52:37
linux
fokin_nikolay1989, 2018-06-29 15:52:37

How to output data to csv?

Good afternoon, there is a script that displays 2 columns, how can I display this whole creation by cells into a csv file

SET NAMES WIN1251;
select table_name from table;
select dp.code, DP.INSTANCE_CODE, count(*)
from DX DP
where DP.STAT = 2
group by 1,2
order by count(*) desc;
OUTPUT TO '/opt/sometable.csv' FORMAT ASCII DELIMITED BY ',' QUOTE ''

What did I do wrong? Run in Linux

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2018-06-29
@d-stream

Armor-piercing:

select 
    row = field_1 +","+field_2+","+field_3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question