To select random rows from your table with limiting how many rows to return. The easiest way to generate random rows in MySQL is to use the ORDER BY RAND() clause
SELECT col1 FROM tbl ORDER BY RAND() LIMIT 10;
No comments:
Post a Comment