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: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Mon, 04 Aug 2003 08:11:34 +0200
Message-ID: <g6uriv8h6cfeo1ojk1q0n4gqjfig2k4l2j@4ax.com>


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

Original text of this message

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