Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: GROUP BY and ..not a group by expression

Re: GROUP BY and ..not a group by expression

From: <fitzjarrell_at_cox.net>
Date: Sat, 06 Oct 2007 14:31:44 -0700
Message-ID: <1191706304.102594.184610@g4g2000hsf.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US