Home > Database > Mysql Tutorial > 随机从数据表中取N条数据(mysql)_MySQL

随机从数据表中取N条数据(mysql)_MySQL

WBOY
Release: 2016-06-01 13:48:08
Original
1098 people have browsed it

bitsCN.com
随机从数据表中取N条数据(mysql) SELECT * FROM faq WHERE id >=  ((SELECT MAX(id) FROM faq)-   (SELECT MIN(id) FROM faq)) * RAND() +  (SELECT MIN(id) FROM faq) LIMIT 9 bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template