Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL to return certain number of a column values concat to each other?
Thanks Scott! also many thanks to Conan for his throrough reply!
I think he provided the answer without the need to write a function or a procedure!
Thanks again guys!
Adam Tadj
In article <39CE6B90.DC583AC9_at_one.net>,
Scott Schaefer <saschaef_at_one.net> wrote:
> 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.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Sep 25 2000 - 12:03:46 CDT
![]() |
![]() |