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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting a Query to a number of records 2

Status
Not open for further replies.

elquiff

Technical User
Mar 5, 2003
26
GB
Please help and the answer might be simple.

I have a table that I wish to run a query on to pull back only the firt 10 rows. Does anybody know the sql command that will do this. In mysql its limit.

Thanks
 
You need to use TOP.

eg.

SELECT TOP 10 <field>, <field> FROM <table>....etc

There are two ways to write error-free programs; only the third one works.
 
cheers it works new it would be something simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top