Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Top() in Sybase SQL??? 2

Status
Not open for further replies.

rchandr3

Programmer
Jun 16, 2003
244
0
0
US
Hi Is there a way in which I retrieve the top N records from Sybase DB?

Thanks a lot,,,,
 
....Like in MS SQL Server ?
No - I don't think there is.

Dickie Bird (:)-)))
 
You can do a
Code:
set rowcount n
before running the query. So
Code:
set rowcount 500
select * from table
will return the first 500 rows.

Greg.
 
If you want the top10 prices from a table ie..
u can use

set rowcount10
select price from table
order by price desc

 
Thats wonderful grega! A Star for you.

Thanks a lot..... Thanks to mjuell and all who tried

Cheers,

Ravi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top