greetings of the day
my question is....
how can i select any random data from a table.
i want to pick any row randomly from table.how can i do that.
How can i select any random data from a table
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

TulasiRank #2,544 · 549 reputationPosted Oct 14, 2011, 3:03 AM EDT
The NEWID() system function makes a unique value of the type uniqueidentifier. There is no need to add a new column in your table to get the random records. you just have to include the NEWID() system function in the ORDER BY clause of your SELECT statement
example for getting FIVE random records
SELECT TOP 5 eid,ename FROM emp
Ex: for one record
SELECT TOP 1 eid,ename FROM emp
Please do not forget to mark "Accpeted Answer".