记录下mysql随机取数据的sql,效率高
SELECT * FROM niceimg WHERE id >= ( (SELECT MAX(id) FROM niceimg) - (SELECT MIN(id) FROM niceimg) ) * RAND() + (SELECT MIN(id) FROM niceimg) LIMIT 1
记录下mysql随机取数据的sql,效率高
SELECT * FROM niceimg WHERE id >= ( (SELECT MAX(id) FROM niceimg) - (SELECT MIN(id) FROM niceimg) ) * RAND() + (SELECT MIN(id) FROM niceimg) LIMIT 1