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

Home -> Community -> Usenet -> c.d.o.tools -> Re: A NEWBIE QUESTION ON SQL

Re: A NEWBIE QUESTION ON SQL

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/06/10
Message-ID: <960645511.24652.3.pluto.d4ee154e@news.demon.nl>

select * from tab t1
where acc attempt =
(select max(acc attempt)
 from tab t2
 where t2.per no = t1.per no)

Hth,

Sybrand Bakker, Oracle DBA

  "Praveen" <praveen_at_swt.edu> wrote in message news:394243D8.6F12F9E6_at_swt.edu...
  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?

  Thankyou
  Praveen

--
Received on Sat Jun 10 2000 - 00:00:00 CDT

Original text of this message

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