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: Return rowid with max()

Re: Return rowid with max()

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Mon, 4 Aug 2003 10:17:14 -0700
Message-ID: <aGwXa.4$ph1.178@news.oracle.com>

"music4" <music4_at_163.net> wrote in message news:bgklkh$qnb_at_netnews.proxy.lucent.com...
> Greetings,
>
> Say I have a table with two columns: name, score. I want to get name of
the
> highest score. I wrote following SQL statement:
>
> select name from tbl where score = (
> select max(score) from tbl)
>
> The statement includes two select, is there a way to use only one select
to
> get the name of highest score's name?

2 selects with inner view:

select * from (

select * from emp order by sal desc

) where rownum =1 Received on Mon Aug 04 2003 - 12:17:14 CDT

Original text of this message

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