帝国cms调用信息按收藏数排序SQL
2016-04-14 00:00:00
帝国CMS
人点赞
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 jo
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 jo
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等条件可以根据自己的需求来调整!
很赞哦! (
)
相关文章
830*140广告