帝国CMS教程:调用信息按收藏数排序SQL
606 人阅读 | 时间:2020年01月29日 09:36
阿里云服务器 | 腾讯云服务器 | VPS2EZ:老牌低调VPS | ZJI:香港日本美国独服 |
LOCVPS服务周到 | HostKvm低调KVM VPS | 傲游主机:优质VPS | 80VPS:老牌VPS主机 |
搬瓦工:CN2 GIA线路 | CloudCone:性价比高 | JustMySocks科学上网 | RackNerd:超级便宜 |
JustMySocks科学上网 | 好用的宝塔面板 | 购买搬瓦工VPS | 恒创:香港CN2服务器 |
SQL:
select a.id,a.classid,a.title,a.titlepic,a.username,a.userid,a.applynum,a.onclick,a.titleurl,b.id,b.classid,count(b.id) fromphome_ecms_news as a left join phone_enewsfava as b on a.id=b.id and a.classid=b.classid where a.classid=1 anda.ispic=1 group by a.id order by count(b.id) DESC limit 5
其中的信息表、栏目id等条件可以根据自己的需求来调整!
评论专区