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 -> Select the row with the highest value

Select the row with the highest value

From: Kalamaro <feman_at_usuarios.retecal.es>
Date: Sun, 20 Jan 2002 14:48:21 +0100
Message-ID: <a2ehvu$vnnv3$1@ID-115330.news.dfncis.de>


Hi. I want to select the row (just one) with the highest value of a given column. I mean, if i have the columns "data" and "date", i need to get the value of "data" where "date" is the most recent (the highest value of this field).

I've tried several ways but they don't work:

"select max(date) from table" -> this selects the newest date, but i want to
get the value of "data", and if i put
"select data,max(date) from table" it doesn't work
"select data from table where rownum=1 order by date desc" -> returns a bad
value, not the last

 thanks Received on Sun Jan 20 2002 - 07:48:21 CST

Original text of this message

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