Home > Backend Development > PHP Tutorial > 求1sql语句的写法

求1sql语句的写法

WBOY
Release: 2016-06-13 12:49:43
Original
763 people have browsed it

求一sql语句的写法
我需要在留言表中查询最新的30条留言,然后这30条还要随机显示。


------解决方案--------------------
补充一下,就可以了
<br />
select * from (SELECT * FROM xxx order by xxx desc limit 30) t order by rand() limit 5<br />
Copy after login


引用:
SQL可以做到,只是真心不高效
SQL code?1select * from (SELECT * FROM xxx order by xxx desc limit 30) t order by rand()
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