• 分区取前几名,后几名


    select * from sc where (select count(*) from sc sc2 where sc2.score>sc.score and sc2.class=sc.class)<=2 order by sc.class,sc.score desc;
    select * from sc having (select count(*) from sc t1 where t1.class=sc.class and t1.score>=sc.score)<=3;
    select * from sc where exists (select count(*) from sc sc2 where sc2.score>sc.score and sc2.class=sc.class having count(*)<=2) order by sc.class,sc.score desc;
    select t1.sid,t1.class,t1.score from sc t1,sc t2 where t1.class=t2.class and t2.score>=t1.score group by t1.sid,t1.class,t1.score having count(t2.sid)<=3 order by t1.class,t1.score desc;

  • 相关阅读:
    Domain Space
    Class WriteGroupAttribute
    HelloCube:IJobForEach
    HelloCube:ForEach
    组件
    世界
    DOTS默认情况下的性能
    ECS适合你吗?
    DOTS原则和愿景
    Packages window(包窗口)
  • 原文地址:https://www.cnblogs.com/zuoxingyu/p/2948354.html
Copyright © 2020-2023  润新知