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

return only 20 from select query

Status
Not open for further replies.

djam

Technical User
Joined
Nov 15, 2002
Messages
223
Location
CA
Hello,

How would I return only 20 results from a select query which might return more then this?

" ahhh computers, how they made our lives much simpler ;) "
 
SELECT TOP 20 *
FROM Table_A

should work fine.

Snowcrash
 
If you are going to return only 20 records make sure you have an order by cluase or you will not get the 20 records you want as the database order is not always the same.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top