文章表
从随机栏目下随机取几条符合条件的记录
求高效写法
数据库是mysql的,但是没人回答,到这边试试
------解决方案--------------------
- SQL code
select a.* from `user` as awhere (select count(1) from `user` where name >= a.name and id=a.id) <=2order by rand();
select a.* from `user` as awhere (select count(1) from `user` where name >= a.name and id=a.id) <=2order by rand();