Hi
I want to select a random row in SQL& MySQL?
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hi Sam
I don’t know what the case you need this to, but anyway you can use the following query to get random row from employees table as an example. 1- Oracle :
2- MySQL :
The idea here in both examples is to get all rows in employees table but in random orders then using ROWNUM in Oracle and LIMIT clause in MySQL to return one row from them.