- SELECT * FROM tableName ORDER BY RAND () LIMIT n small amount of data, then also, data volume up, affecting the performance.
- The table ID, assuming there are 1000 data in the table, then the random number to Mr. 1000, such as into the array, and then traverse, and where id = randnum, query cycle n times. I can not think of another way.
n data taken randomly mysql
Guess you like
Origin www.cnblogs.com/bneglect/p/11324208.html
Ranking