Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Crosstab-like query or Sybase's LIST function in Oracle ??
Hi,
Did anybody succeed in making a crosstab-like query in Oracle ?
For ex. if I have the following in my table:
> SQL> break on fld1
> SQL> select * from crosstab;
>
> FLD1 FLD2
> ---------- ----------
> 1 11
> 12
> 13
> 14
> 15
> 2 21
> 22
> 23
>
> 8 rows selected.
I'd like to get something looking like:
> SQL> select fld1, list(fld2) from crosstab [group by fld1];
>
> FLD1 FLD2
> ---------- ------------------
> 1 11, 12, 13, 14, 15
> 2 21, 22, 23
> SQL>
as it's possible to do with Sybase. Did someone ever manage getting
that kind of stuff either in pure SQL or with a user-defined procedure
??
Thanks a lot !!
Spendius
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Thu Sep 02 1999 - 09:18:01 CDT
![]() |
![]() |