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: Yns <lovelyspam_at_england.com>
Date: 2000/06/07
Message-ID: <393E0E34.498D8AEB@england.com>#1/1

Walter T Rejuney 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.

Use ROWID in your query.

eg.

select a.name
from table a
where a.rowid = (select max(b.rowid)

                  from   table b
                  where  a.name = b.name)
Received on Wed Jun 07 2000 - 00:00:00 CDT

Original text of this message

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