Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET HEADING OFF;
- SELECT DISTINCT '"' || REPLACE(TRIM(COALESCE(x.column, '')), '"', '""')
- || '"; "' || REPLACE(TRIM(COALESCE(x.column2, '')), '"', '""')
- || '"; "' || REPLACE(TRIM(COALESCE(list(DISTINCT x.column3, ','), '')), '"', '""')
- || '";'
- FROM (
- SELECT ycolumn AS column, ycolumn1 AS column1, ycolumn2 AS column2, list(DISTINCT ycolumn3, ',') AS column3
- FROM (
- SELECT d.column AS ycolumn, c.column1 AS ycolumn1, dc.column2 AS ycolumn2, ws.column3 AS ycolumn3
- FROM ...
- )y
- GROUP BY ycolumn, ycolumn1, ycolumn2
- ) x
- GROUP BY x.column, x.column1, x.column3
- ;
- ==============================================================================
- 0:218
- ==============================================================================
- CONCATENATION:
- "field"; "field1"; "field2"; "field3";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement