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: SQL - Select 1 row only from a table.

Re: SQL - Select 1 row only from a table.

From: dnh <nogood_at_using.this.addr.com>
Date: Thu, 1 Apr 2004 11:27:18 +0100
Message-ID: <406b7e08@cpns1.saic.com>


if you want to get the first one in a particular order you need to use an inline view

select t2.*
from (select t1.* from table t1 where t1.column = 'x' order by t1.y) t2 where t2.rownum =1

--
to reply, remove flintstones names from the addr below
fred.nillspam.barney_at_yahoo.com
"Craig Burtenshaw" <crb_at_amsa.gov.au> wrote in message
news:406b8559$0$93305$c30e37c6_at_lon-reader.news.telstra.net...

> Hi,
>
> Is there away of selecting records from a table using 'select (1) from
table
> where column = x' and
> as soon as there one record (out of a possible 100), stop and give a
> response?
>
> Oracle 8.1.7.4
> Solaris 2.7
>
> Thank you
> Craig.
>
>
Received on Thu Apr 01 2004 - 04:27:18 CST

Original text of this message

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