当前位置:   article > 正文

MYSQL 使用@rowNo获取排名_mysql获取rowno

mysql获取rowno

首先,看看@rowNo的用法:

select  @rowNo := @rowNo as rank FROM (select @rowNo :=1) q
  • 1

在看具体引用,如何排名:

SELECT * FROM (select  @rowNo := @rowNo + 1 as rank, ppr.uid from poem_program_read ppr LEFT JOIN poem_user pus ON pus.id = ppr.uid,
  (select @rowNo :=0) q  WHERE ppr.pid = #{pid}
order by ppr.likeCount DESC,ppr.create_time) t
WHERE t.uid = #{uid}
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/938669
推荐阅读
相关标签
  

闽ICP备14008679号