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

Random Records Pull in Query

Status
Not open for further replies.

akrshaw

Programmer
Oct 24, 2006
77
US

I have read the random records posts using rnd() and the Top 10 sql.

But none of these seem to be returning what I am looking for.

I have a HUGE table...I want to return 26 random records in that table.

The only two fields are ID and Word.

When I use either solution above all I get are the first 26 records in the table?

Thanks!~
 
Works fine for me.
SELECT TOP 26 Products.ProductID, Products.ProductName, Rnd([productID]) AS SortOrder
FROM Products
ORDER BY Rnd([productID]);

You have to seed the RND with a different value for each record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top