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!

Select a random row

Status
Not open for further replies.

Dudek

Technical User
Jan 14, 2002
27
MY
Hi there..

ANybody knows how to select a random row from a table?

The table has a key, but the key's number jumps occasionally so i couldnt use like below:

select convert (int, max(key) * rand())

for a random key, as it will sometimes give out a null number

So anybody can help me here?

Thanks
JD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top