I'm familiar with MySQL but not in MS SQL,
In MySQL the query will be like this:
SELECT * from tablename ORDER BY RAND() LIMIT 5
The above query gives a 5 random number of result from the table. The same query how can i do with MS SQL?
Try,
SELECT TOP 5 * from tablename ORDER BY NEWID()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With