How do I select random rows in MySQL?

后端 未结 9 1147
慢半拍i
慢半拍i 2020-12-08 23:09
mytable

pid name field
=== ==== =====
1    A1   0
2    A2   1
3    A3   1
4    A4   0   
5    A5   0

This is my table structure. Here I want to se

9条回答
  •  萌比男神i
    2020-12-08 23:53

    Generally, using ORDER BY RAND() is not a good idea. Please read the text by Jan Kneschke, showing why: http://jan.kneschke.de/projects/mysql/order-by-rand/

提交回复
热议问题