復(fù)制代碼 代碼如下:
SELECT * FROM table_name ORDER BY rand() LIMIT 5;
復(fù)制代碼 代碼如下:
MySQLl> select RAND();
-> 0.5925
MySQLl> select RAND(20);
-> 0.1811
MySQLl> select RAND(20);
-> 0.1811
MySQLl> select RAND();
-> 0.2079
MySQLl> select RAND();
-> 0.7888
復(fù)制代碼 代碼如下:
UPDATE cdb_posts SET views = rand();
復(fù)制代碼 代碼如下:
SELECT * FROM `table` ORDER BY RAND() LIMIT 5
新聞熱點(diǎn)
疑難解答
圖片精選