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, 10:35 am, sen..._at_gmail.com wrote:
> > select id, name, testdate, marks
> > from students
> > where (id, marks) in
> > (SELECT ID, MAX(MARKS)
> > FROM STUDENTS
> > GROUP BY ID);
>
> Wouldn't this return results from other dates too? though all we are
> looking for is Max(marks) immaterial of date?
Only the date that went with the max(marks). Of course if that same student got that same max mark on two different dates then both of them would show up in the results. Received on Mon Oct 08 2007 - 09:34:51 CDT
![]() |
![]() |