Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: newbie pl/sql question
mdbluecrab_at_adelphia.net schrieb:
> I'm fairly new to pl/sql, and I'm having some problems. I'm trying to
> process a list of records, group them based upon CL_KEY and then add a
> sequence, based upon OPTION.
>
> CL_ID CL_KEY OPTION
> ------- ---------- ------
> 1234567 abcdef 999
> 1234567 abcdef 998
> 1234567 abcdef 997
>
> 1234568 abcdeg 999
> 1234568 abcdeg 997
> 1234568 abcdeg 995
>
>
> I can group on either CL_ID, or CL_KEY, order by OPTION, and I would
> like to add a 2 digit seq number CL_ID_SEQ. CL_ID_SEQ should reset to
> '00' for each new CL_ID.
> The OPTION column may have gaps in between numbers.
>
> CL_ID CL_KEY OPTION CL_ID_SEQ
> ------- ---------- ------ ---------
> 1234567 abcdef 999 00
> 1234567 abcdef 998 01
> 1234567 abcdef 997 02
>
> 1234568 abcdeg 999 00
> 1234568 abcdeg 997 01
> 1234568 abcdeg 995 02
>
>
> Any ideas?
>
>
> Thanks
>
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions137.htm#i86310 http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14223/analysis.htm#sthref1721
Best regards
Maxim Received on Wed Mar 07 2007 - 11:02:23 CST
![]() |
![]() |