Out of Memory
Saturday, January 12, 2013
SQL to concatenate column values from multiple rows
There are a few ways depending on what version you have
http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php
SELECT
pid
,
LISTAGG
(
Desc
,
' '
)
WITHIN
GROUP
(
ORDER
BY
seq
)
AS
desc
FROM
B
GROUP
BY
pid
;
Then join to A to pick out the pids you want.
http://stackoverflow.com/questions/4686543/sql-to-concatenate-column-values-from-multiple-rows
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment