You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
查询:
1、发布时间是2024年度
2、每个学段每个科目上传课程数量按由多到少排序
3、字段名: 学段,科目,排名,课程数量
*/
SELECT stage_name AS , subject_name AS , ROW_NUMBER() OVER (PARTITION BY stage_name ORDER BY COUNT(*) DESC) AS , COUNT(*) AS FROM t_crawler_lesson WHERE publish_time >= '2024-01-01' AND publish_time < '2025-01-01' AND gather_regionc IS NOT NULL AND gather_regionc <> '' GROUP BY stage_name, subject_name ORDER BY stage_name, DESC;
/*
查询:
1、发布时间是2024年度
2、每个行政区每个学校都上传了多少课程数量
3、格式: 行政区划名,学段,排名,学校名称,课程数量
*/
SELECT gather_regionc AS , stage_name AS , ROW_NUMBER() OVER (PARTITION BY gather_regionc ORDER BY COUNT(*) DESC) AS , teacher_school_name AS , COUNT(*) AS FROM t_crawler_lesson WHERE publish_time >= '2024-01-01' AND publish_time < '2025-01-01' AND gather_regionc IS NOT NULL AND gather_regionc != '' GROUP BY gather_regionc, stage_name, teacher_school_name ORDER BY gather_regionc, COUNT(*) DESC;
/*
查询:
1、发布时间是2024年度
2、二道区每个学校都上传了多少课程数量
3、格式: 行政区划名,学段,排名,学校名称,发布年份,课程数量
*/
SELECT gather_regionc AS , stage_name AS , ROW_NUMBER() OVER (PARTITION BY gather_regionc ORDER BY COUNT(*) DESC) AS , teacher_school_name AS , EXTRACT(YEAR FROM publish_time) AS , COUNT(*) AS FROM t_crawler_lesson WHERE publish_time >= '2024-01-01' AND publish_time < '2025-01-01' AND gather_regionc = '二道区' AND gather_regionc IS NOT NULL AND gather_regionc != '' GROUP BY gather_regionc, stage_name, teacher_school_name, EXTRACT(YEAR FROM publish_time) ORDER BY gather_regionc, DESC;