Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Return rowid with max()
"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