Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query HELP : Need ID After Doing "Group By"
Suggestion 1 here seems to work best. A neat trick. Thanks to all for the
responses...
"Thomas Kyte" <tkyte_at_us.oracle.com> wrote in message
news:a346tc02j3c_at_drn.newsguy.com...
[...]
> ops$tkyte_at_ORA817DEV.US.ORACLE.COM> select item_class,
> 2 to_number(substr(data,1,10)) version,
> 3 to_number(substr(data,11)) id
> 4 from (
> 5 select item_class, max( to_char(version,'fm0000000009') || id ) data
> 6 from t
> 7 group by item_class
> 8 )
> 9 /
>
> ITE VERSION ID
> --- ---------- ----------
> ABC 1885 3
> PQR 825 5
> XYZ 59 9
>
Received on Tue Jan 29 2002 - 18:02:54 CST
![]() |
![]() |