Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - Select 1 row only from a table.
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...Received on Thu Apr 01 2004 - 04:27:18 CST
> 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.
>
>