Click here to Skip to main content
16,023,103 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i'm having an 'n' number of rows in an column..in that i want to select only 5 values that to in random..is this possible for me to get the random values????
Posted

1 solution

SQL
SELECT TOP 5 * FROM [MyTableNameHere] ORDER BY NEWID();


more options via google[^]
 
Share this answer
 
Comments
Gopinath1005 29-Mar-12 6:14am    
working fine...
thank yu boss.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900