Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: about extending query
Hi Charles,
One solution could be that you create a simple table like
SQL> create table foo(id number(10));
And you fill it with so many rows (the values really doesn't matter) how is the biggest value in TOTAL column in your table.
So in example you wrote, it would be 4 rows.
And then select could be like this :
SQL> select a.name, 2 a.total, 3 b.sn
NAME TOTAL SN
---------- --------- ---------
cmpA 4 1 cmpA 4 2 cmpA 4 3 cmpA 4 4 cmpB 3 1 cmpB 3 2 cmpB 3 3
HTH, Erika
CL wrote:
>
> Hi there
>
> I have a case need to extend a table like this
> name total
> cmpA 4
> cmpB 3
>
> into the table like this
>
> name total sn
> cmpA 4 1
> cmpA 4 2
> cmpA 4 3
> cmpA 4 4
> cmpA 3 1
> cmpA 3 2
> cmpA 3 3
>
> Can any noe help? thanks in advance.
>
> Charles
Received on Fri Jun 25 1999 - 02:20:45 CDT
![]() |
![]() |