标签:
在网上找了再三,通过比较,确认了以下的方法是可行的 :
SELECT @rownum:=@rownum+1 rownum, CollectSn From (SELECT @rownum:=0,bbgmain.* FROM qbdb.bbgmain WHERE collectsn!=‘‘ ORDER BY collectsn limit 10) t
按照点击数排序,查询new表里的文章排名
select * from ( select @rank:=@rank+1 as rank, id, title from (select @rank:=0, news.* from news order by dian_num desc) rank) news_rank where id = 4;
标签:
原文地址:http://www.cnblogs.com/phpfans/p/4888179.html