Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Combining column values across rows with sorting

Re: Combining column values across rows with sorting

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 12 Jun 2006 08:46:12 -0700
Message-ID: <1150127175.353832@bubbleator.drizzle.com>


puneet wrote:
> Hi,
> I'm absolutely new to oracle & have been asked to write a query which
> combines multiple columns into a single row.I'm sure that this can be
> done using 9i but havent been able to figure out how.
> The table is:
>
> Emp ID Code Name
> 1 d ddd
> 1 b bbb
> 1 c ccc
> 1 a aaa
> 2 p ppp
> 2 z zzz
> 2 a aaa
>
> Req o/p using a query is:
>
> Emp ID Details(sorted according to Code before
> concatenation)
> 1 aaa,bbb,ccc,ddd
> 2 aaa,ppp,zzz
>
> I'll highly appeciate it if anyone can tell me the query to get this
> result.
> Thanks.

www.psoug.org
Click on Morgan's Library
Click on DECODE

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Jun 12 2006 - 10:46:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US