Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Help - Selecting record based on greatest value

Re: SQL Help - Selecting record based on greatest value

From: <steveee_ca_at_my-deja.com>
Date: Thu, 04 Jan 2001 19:57:40 GMT
Message-ID: <932kjg$s81$1@nnrp1.deja.com>

Hi James,

To select the record with the highest value in column c :

select *from X
where c = (select max(c) from X);

Remember though, this doesn't guarantee that one row only will be returned from the query. However it will work if c is a date field.

Hth,

Steve

In article <932ict$8iist$1_at_ID-68406.news.dfncis.de>,   "James Alexander Starritt" <james_at_jamesstarritt.com> wrote:
> I have a table we can call x ... it contains 3 field a b c
>
> assuming c is a number is it possible to select the record with the
 greatest
> value ? ... and if so does this work on date fields
>
> --
>
> James Alexander Starritt (james_at_jamesstarritt.com)
>
>

Sent via Deja.com
http://www.deja.com/ Received on Thu Jan 04 2001 - 13:57:40 CST

Original text of this message

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