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!

how to sql query for random samplings of large table

Status
Not open for further replies.

pingponger

Programmer
Jan 23, 2005
4
US
For sql query I want to sample a large table. How to pull off say the first 10 records skip 5000 records pull next 10, etc.

 
To select 100 random records:
SELECT TOP 100 * FROM yourTable
ORDER BY Rnd([some numeric field]);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top