How to selecte random records from SQL Server table?

Total Post:134

Points:940
 2288  View(s)
Ratings:
Rate this:
Hello Everyone,
I want to select records randomly from my SQL Server table. Could you explain it with the code that how to do it?

Thanks in advance!!
  1. Post:68

    Points:476
    Re: How to selecte random records from SQL Server table?

    Hi Tanuj Kumar,
    In SQL Server database, there is a function NEWID() through which we can select SQL table record randomly.
    Query:

     select * from tbl_Name order by newid()

    I hope it might be resolve your problem.


      Modified On Mar-29-2018 05:08:01 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.