|
|
发表于 2022-6-4 05:13
来自手机
|
显示全部楼层
create temp table aa as select 班级,姓名,语文,数学,外语,物理_历史,化学_政治,生物_地理 from 高一成绩按班类科目排名的百分之二十;create temp table bb as select 班类,班级2 班级 from 高一成绩按班类科目排名的百分之二十;create temp table cc as select * from bb join aa using(班级);cli_one_dim~temp.cc~3;create temp table dd as select *,rank() over (partition by 班类,属性 order by 数量 desc) 排名,round(cume_dist() over (partition by 班类,属性 order by 数量 desc)*100) 排名2 from ccunion;create temp table ee as select * from dd where 排名2<=20; create temp table ff as select 班类,班级,属性,count(姓名) 人数 from ee group by 班类,班级,属性;cli_build_two_dim~ff~属性~人数;select * from ff_two_dim;select 班类,group_concat(语文||数学||外语||物理_历史||化学_政治||生物_地理) 子表 from ff_two_dim group by 班类;
按 班类 内部排名?然后各科总人数20%中各班人数? |
|