In Oracle you could get the first row of a results set by adding the "rownum
<= 1" condition.
select * from your_table
where your_conditions
and rownum <= 1
When the first row is found, no more processing is done.
----- Original Message -----
From: "Peter Bryden" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: lunes 9 de abril de 2001 19:18
Subject: Re: Help: H0w to get frist row at SQl Server DB
> try
> select top 1 * from table
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Thomas McManus
> Sent: 09 April 2001 17:28
> To: [EMAIL PROTECTED]
> Subject: Re: Help: H0w to get frist row at SQl Server DB
>
>
> Does your SQL support a limit select statement?
> (mySQL does) Try:
>
> select * from Table limit x,y
>
> where x = starting row (0 being the first row)
> and y = the number of rows to return.
> If so:
>
> select * from Table limit 0,1
>
> should return only the first row
>
> -Tom
>
> "Zhang, David" wrote:
>
> > HI, All
> >
> > Help: H0w to get frist row at SQl Server DB
> >
> > I have a huge table, but I only want to get the first row and I do not
> want
> > use
> > select * from Table to get WHOLE thing.
> > Thnaks a lot in advance!
> >
> >
>
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
============================================================================
===
>
> Traffic Interactive Limited
> 191 Old Marylebone Road
> London
> NW1 5DW
> United Kingdom
> Registered number: 3164767
> Registered in England
>
> Tel: +44 (0) 20 7298 8200
> Fax: +44 (0) 20 7298 8201
>
>
> This email its contents and any files or images with it are intended
solely
> for the addressee(s) and are confidential. If you have received this email
> in error you may not copy or use the contents, attachments or information
in
> any way. Please destroy it and contact the sender on the number printed
> above, via the Traffic Interactive switchboard or via email return.
>
> DISCLAIMER
> Material contained in this email may be copyright material of
> Traffic Interactive or protected by other intellectual property rights. It
> may only be reproduced with the express permission of Traffic Interactive.
> Traffic Interactive does not accept responsibility for any changes made to
> this email by unauthorised parties after it was sent. Whilst Traffic
> Interactive runs antivirus software on all Internet emails it is not
> liable for any loss or damage caused by an infected email. The recipient
> is advised to run their own antivirus software. All information contained
> in this email has been prepared using information believed by the author
> to be reliable and accurate, but Traffic Interactive makes no warranty as
> to accuracy and completeness. Any opinions expressed in this email are
> those of the author and do not necessarily reflect the opinions of Traffic
> Interactive or its affiliates.
>
>
============================================================================
===
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html