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: Select one row

Re: Select one row

From: Nicolas Bronke <NBronke_at_t-online.de>
Date: 11 Nov 1998 20:41:23 GMT
Message-ID: <72cspj$l1k$1@news01.btx.dtag.de>


Whith that you only get the first if you have additional where statements. The rownum represents the a serie in which kind you have inserted your records.

eg. select * from table where rownum=1 returns the first inserted record

       select * from table where rownum=1 and fieldcondition returns the really first record

Perhaps you should also consider to use   select * from table where distinct-Keys=(select min(distinct-Keys) from table)
replace distinct key in whatever you mean.

Regards
Nicolas Bronke

Sven Heins schrieb in Nachricht <364954BC.BB13151A_at_solution42.de>...
>Kenneth Herskedal wrote:
>
>> How can I select only the first row from a table.
>>
>> My select statement returns several rows, but I'm only interested in the
>> first row of the result set.
>
>Hi Kenneth,
>
>try ...where rownum = 1...
>
Received on Wed Nov 11 1998 - 14:41:23 CST

Original text of this message

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