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: 'SUM' strings to concatenated string

Re: 'SUM' strings to concatenated string

From: sim <jmenker_at_muenster.de>
Date: 17 Feb 2006 04:23:54 -0800
Message-ID: <1140179034.396200.119270@f14g2000cwb.googlegroups.com>


If you know how many entries you get you can pivot them using group by. After that you can concatenate the columns. Works like this

select max(name1),

          max(name2),
          max([...])

(

select case when nr = 1 then username end name1,
          case when nr = 2 then username end name2,
          [...]

(

select rownum nr,

          username
from table
)
)

Regards,

Jörg Received on Fri Feb 17 2006 - 06:23:54 CST

Original text of this message

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