Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Return rowid with max()
On Mon, 4 Aug 2003 11:56:59 +0800, "music4" <music4_at_163.net> wrote:
>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?
>
>Thanks in advance!
>Evan
>
No, or it would involve an inline view, and it that case you still have 2 selects. I also can't see any sensible objection against your statement.
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Mon Aug 04 2003 - 01:11:34 CDT