Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: A NEWBIE QUESTION ON SQL
Try this
Select per_no,max(acc_att)
from tab
group by per_no
"Thomas J. Kyte" <tkyte_at_us.oracle.com> wrote in message
news:8htinb$qhf$1_at_nnrp1.deja.com...
> In article <394243D8.6F12F9E6_at_swt.edu>,
> Praveen <praveen_at_swt.edu> wrote:
> >
> > --------------0D7A7375526DC6F2967516F0
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > Hi,
> >
> > I have a table "tab" :
> >
> > per_no acc_attempt percentage
> > 1 1 76
> > 1 2 56
> > 1 3 85
> > 2 1 55
> > 2 2 65
> > 2 3 75
> > 3 1 45
> > 3 2 55
> > 3 3 65
> > 3 4 75
> >
> > I am trying to write a query that can retrieve the rows which i have
> > highlighted and underlined above from the table, that is i want those
> > rows to be retrieved from the table where for each 'per_no' the
> > 'acc_attempt' is maximum.
> >
> > Can anybody suggest a way to accomplish this?
> >
>
>
>
>> > <p>I have a table "tab" :
> > Thankyou
> > Praveen
> >
> > --------------0D7A7375526DC6F2967516F0
> > Content-Type: text/html; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> > <html>
> > Hi,
>
>
>
> >