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, 9: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?
It's up to YOU to restrict your result set according to your wants; examples are simply that, EXAMPLES and should be taken as 'this is generally how this is done'. I did not claim to post the answer, but I did post a relevant response relative to the OP's original assessment of the base query.
David Fitzjarrell Received on Sat Oct 06 2007 - 16:31:44 CDT
![]() |
![]() |