你都回答解释完了, 好吧 那我就通过另外的SQL思路 来解决这个select name,score,(select count(distinct score) from t where score>a.score)+1 from t a order by score 这样就生成了年级排名 然后 一到50的排名数量 用数据列 排名字段 汇总 个数 然后设置过滤条件 小于或者等于50 这样就可以取得1-50的个数 51-100的方法同样使用这个方法 这样也是可以解决你的方法的 编辑于 2018-10-13 12:46
|