Re: Selecting only the first row from a query

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1995/11/30
Message-ID: <49k99n$d2e_at_tpd.dsccc.com>#1/1


select what_not
  from people
 where name = 'Nylund'
   and rownum = 1;

Joel Nylund (joel_nylund_at_mail.amsinc.com) wrote:

:> I need to write a sql statement to only return the first row that meets
:> the criteria. For example I have a table called people with names and
:> phone numbers. There may be several "Joel Nylund's" in the table, I only
:> want the first one I find.
 

:> in DB2, I can do a select first
 

:> I am looking for something that will work in oracle and sybase.
 

:> thanks in advance
:> Joel

--
This posting represents the personal opinions of the author. It is not the
official opinion or policy of the author's employer. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Thu Nov 30 1995 - 00:00:00 CET

Original text of this message