Is it possible to retrieve random rows from table X where flags==0?
Using MySql and C#
Is it possible to retrieve random rows from table X where flags==0? Using MySql
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine 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.
This retrieves 1 random row. Replace 1 by N to get N random rows.
Caveat: As others pointed out this can be slow as it needs a full table scan. I used to do this with DB2, where this worked perfectly for tables with hundreds of thousand of rows, but according to the link in tereško’s answer, MySQL seems to degrade much quicker.