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

How do I 'Shuffle The Deck' using SQL?

Status
Not open for further replies.

martin555

Programmer
Feb 15, 2001
1
US

I have a table that I want to read through sequentially. The challenge is, each time the program is run I want to process the records in a different order, kind of like 'shuffling the deck' of a deck of cards. There are only about 300 records so I could read them into a table in a program and then scramble them, but how? Please advise.
 
Well if you add an extra field at the end like RandomNum
And open the table and write a Random number to each record. Then when done adding records, resort by Ascending by that field. Or swap them by sorting in Descending order too.
Use the RND function.
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top