| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: auto increment in select clause
"Samuel Tribehou" <s.tribehou_at_wanadoo.fr> wrote
> Hello.
>
> I'd like to know how if it is possible to have an auto incremented column
in
> a select clause, like this :
>
> inc | ref
>
> 1 | AAE
> 2 | ADE
> 3 | A3D
>
> where the inc column is generated on the fly.
>
> Thanks in advance.
select count(*) as inc, t1.ref as ref
from atable t1, atable t2
where t2.ref <= t1.ref
group by t1.ref
;
Received on Fri Jun 07 2002 - 00:57:06 CDT
![]() |
![]() |