Re: Help Crafting a Grouping/Listing Query

From: Don Seiler <don_at_seiler.us>
Date: Tue, 7 Apr 2015 01:11:13 -0500
Message-ID: <CAHJZqBBSVQoggL6r7ykKyfh-ipeUNp+mZ0+P7CXiXV07tHuwaA_at_mail.gmail.com>



Works exactly like I needed. Thanks to Alex and T.J.

Don.

On Mon, Apr 6, 2015 at 4:50 PM, Alex Fatkulin <afatkulin_at_gmail.com> wrote:

> 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_at_seiler.us> 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
>>
>
>
>
> --
> Alex Fatkulin,
> http://afatkulin.blogspot.com
>

-- 
Don Seiler
http://www.seiler.us

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 07 2015 - 08:11:13 CEST

Original text of this message