Joined January 2013
·

Alex Seif

Egypt
·
·
·

Posted to Random Rows From MySQL over 1 year ago

Hey guys, I missed the point of needing the max and min table id, but if so, why didn't you use 'SELECT MAX(id), MIN(id) from table' ?
Any how to get 5 random rows
'SELECT *, rand() as rand FROM table_name
ORDER BY rand
LIMIT 5'

Achievements
1 Karma
0 Total ProTip Views