Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query question
On Wed, 3 Jun 1998, Bob McConnell wrote:
> Actually I'm trying to retrieve the complete records which contain
> several other fields. So what I'm trying to accomplish is
> select MAX(taskno),id, otherfield1,otherfield2,etc.
>
> How do I get by "NOT A SINGLE GROUP GROUP FUNCTION"
> error for the other fields I need?
>
Try this one:
select taskno, id, otherfield1, otherfield2 etc
from table1 where taskno||id in (select max(taskno)||id from table1 group by id)
Tommy
Email: tomhag_at_rsv.se Received on Fri Jun 05 1998 - 05:43:32 CDT
![]() |
![]() |