MySQL 给查询结果带上序列号 No

select a.* from (SELECT (@i:=@i+1) i, fixed_duration FROM issue isu, (SELECT @i:=0) as i
where isu.is_valid = 'y'                 
ORDER BY fixed_duration desc) a
WHERE a.i > (select count(*)*0.2 from issue issu where issu.is_valid ='y');
    原文作者:一个会写诗的程序员
    原文地址: https://www.jianshu.com/p/afa42798dcd6
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞