Friday, February 24, 2012

How to retrieve data randomly?

I have a table called Questions and I need to retrieve 10 rows of data randomly each time. If I use
SELECT TOP 10 Question FROM Questions
I'll get the same questions each time when I execute the sql statement. Is there a way to get the random data? Thanks.SELECT TOP 10 Question FROM Questions ORDER BY NEWID()

No comments:

Post a Comment