Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: GROUP BY and ..not a group by expression
On Oct 5, 6:35 am, sen..._at_gmail.com wrote:
> > Homework???
>
> NO, dealing with a badly designed set of tables.
>
> > There are meny solutions: subquery with max() and using analytics are
> > just two of them.
>
> Could please you show an example?
You have the working subquery in your first example producing the student id and max marks; you now need to take that and return the data you want:
select id, name, testdate, marks
from students
where (id, marks) in
(SELECT ID, MAX(MARKS)
FROM STUDENTS
GROUP BY ID);
David Fitzjarrell
Received on Fri Oct 05 2007 - 08:05:33 CDT
![]() |
![]() |