So how do you select a random row in a SQL database table?

[codesyntax lang=”sql”]

SELECT TOP 1 Name, Address, City
FROM         tbl_Person
ORDER BY NEWID()

[/codesyntax]

This will select a random person every time.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.