select group#, listagg(member, ',') within group (order by member) members
from v$logfile
group by group#;
On Mon, Apr 6, 2015 at 5:38 PM, Don Seiler <don@xxxxxxxxx> wrote:
Oracle 11.2.0.3.
For example let's take v$logfile. Let's say I have 2 logfiles per group#.
I'd like to write a query that selects the group number and then puts all
logfiles for that group# in a delimited string in the same row of that
result set. So the result would look something like (using commas as the
delimiter):
GROUP MEMBERS
----- -------
1 /path/to/group1_01.rdo,/path/to/group1_02.rdo
2 /path/to/group2_01.rdo,/path/to/group2_02.rdo
3 /path/to/group3_01.rdo,/path/to/group3_02.rdo
Hopefully I haven't explained it too poorly. I'm just having trouble
wrapping my head around getting the grouping into one field.
Don.
--
Don Seiler
http://www.seiler.us