How can we get the results from a table in a random order in MySQL?

We can use ORDER BY RAND() clause in SELECT query to get the results in a random order in MySQL.

Eg. SELECT * FROM EMPLOYEE ORDER BY RAND();
Above query will return the records from EMPLOYEE table in Random order.

Read the full book at www.amazon.com
Posted in MySQL, MySQL Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*