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');
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');
本文标题:MySQL 给查询结果带上序列号 No
本文链接:https://www.haomeiwen.com/subject/xousxqtx.html
网友评论