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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL to return certain number of a column values concat to each other?

Re: SQL to return certain number of a column values concat to each other?

From: Scott Schaefer <saschaef_at_one.net>
Date: Sun, 24 Sep 2000 17:01:04 -0400
Message-ID: <39CE6B90.DC583AC9@one.net>

Someone smarter than I would have to tell you (and me) how to do this with a view. OTOH, this is doable (even 'simple') with a stored procedure.

But then, that raises question of the ORDER in which the rows are to be returned [which obviously affects the concatenated values]. Is the desired order of the rows from the underlying table fixed [i.e becomes part of stored procedure], or is your desire to do this with a view based on the desire to specify a sort order at time of SELECT ??

adamvt_at_my-deja.com wrote:
>
> I wonder if this is possible with SQL? Say I have a table and if I
> SELECT column of it I get:
>
> SELECT a_col FROM a_tab;
>
> a_col
> -----
> 10
> 5160
> 129
> 230
> 515
> 4000
> 2398
> 456
> 239
> .
> .
> And now I wanna create a view based on this table where I'll be able to
> get something like:
>
> SELECT a_conc_col FROM a_view;
>
> a_conc_col
> -----------
> 10 5160 129
> 230 515 4000
> 2398 456 239
> .
> .
> which concats every three values together. Is this possible? if so
> could you provide an example?
> Thanks in advance!
> Adam Tadj
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Sep 24 2000 - 16:01:04 CDT

Original text of this message

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