Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL problem. return record id in a Group by select query?
Hi,
won't work since ID is an unique key, so that all rows would be selected.
On Thu, 02 Apr 1998 02:17:33 GMT, gennick_at_worldnet.att.net (Jonathan Gennick) wrote:
>On Wed, 01 Apr 1998 18:18:07 -0700, "Kevin P. Fleming"
><kfleming_at_access-laserpress.com> wrote:
>
>>SELECT LineNo, Max(LineType), ID
>>FROM Table
>>GROUP BY LineNo;
>
>You also need to group by ID:
>
> GROUP BY LineNo, ID;
>
>As long as there is a one-to-one between ID an LineNo, you
>will be Ok.
>
>Jonathan
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Thu Apr 02 1998 - 00:00:00 CST
![]() |
![]() |