Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. SET HEADING OFF;
  2. SELECT DISTINCT '"' || REPLACE(TRIM(COALESCE(x.column, '')), '"', '""')
  3. || '"; "' || REPLACE(TRIM(COALESCE(x.column2, '')), '"', '""')
  4. || '"; "' || REPLACE(TRIM(COALESCE(list(DISTINCT x.column3, ','), '')), '"', '""')
  5. || '";'
  6. FROM (
  7. SELECT ycolumn AS column, ycolumn1 AS column1, ycolumn2 AS column2, list(DISTINCT ycolumn3, ',') AS column3
  8. FROM (
  9. SELECT d.column AS ycolumn, c.column1 AS ycolumn1, dc.column2 AS ycolumn2, ws.column3 AS ycolumn3
  10. FROM ...
  11. )y
  12. GROUP BY ycolumn, ycolumn1, ycolumn2
  13. ) x
  14. GROUP BY x.column, x.column1, x.column3
  15. ;
  16.  
  17. ==============================================================================
  18. 0:218
  19. ==============================================================================
  20. CONCATENATION:
  21. "field"; "field1"; "field2"; "field3";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement