Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to show a select in one row
What you want to do is to turn a table on it's side. This can be found
in Oracle, The Complete Reference by Oracle Press. To do this, you need
to use the DECODE function. But with the DECODE function, you need to
know the possible values that you might return. For instance,
SELECT DECODE(id,'1','1',NULL) AS "1", DECODE(id,'2','2',NULL) AS "2", DECODE(id,'3','3',NULL) AS "3"FROM toto;
would return
1 2 3
This isn't quite what you are looking for, but it shows some of the "power" of the decode statement (as well as it's weaknesses).
HTH,
Brian
Jorge wrote:
>
> something like this:
> select * from toto
> id
> ---
> 1
> 2
> 3
>
> select * from toto
> id
> ---
> 123
Received on Tue Sep 07 1999 - 09:22:32 CDT
![]() |
![]() |