Tuesday, June 28, 2011
use listagg to convert columns into rows
SELECT id, LISTAGG(str, ',') WITHIN GROUP (ORDER BY str) AS name
FROM new_test
GROUP BY id;
gives you
1 a,b,c
2 d,e
3 f
from
1 a
1 b
1 c
2 d
2 e
3 f
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment