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: newbie SQL question

Re: newbie SQL question

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 2000/06/06
Message-ID: <8hk10u$qv2$1@nnrp1.deja.com>#1/1

In article <393D6762.58E845D5_at_Unforgetable.com>,   Walter T Rejuney <BlueSax_at_Unforgetable.com> wrote:
> > Halim Setiyawan wrote:
> >
> > Can anyone tell me a sql command in Oracle 8i that selects/updates
> > only the first entry if there are multiple entries to be return?
> >
> > Any help will be appreciated.
> >
> > Halim.
>
> Ever heard of writing a program? You can't do what you want with just
 a
> single select statement most likely but it would be a breeze to handle
> in a pl/sql,pro-c or VB program.
>

kcs as wtr--

this is easy:

update T

   set ....
 where ....
   AND ROWNUM = 1; or

select * from ( select * from T where ... ) where rownum = 1;

--
Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries
Howtos and such: http://osi.oracle.com/~tkyte/index.html
Oracle Magazine: http://www.oracle.com/oramag
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Jun 06 2000 - 00:00:00 CDT

Original text of this message

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