最爱青草蛋糕
最爱青草蛋糕
全部文章
分类
归档
标签
去牛客网
登录
/
注册
最爱青草蛋糕的博客
全部文章
(共94篇)
题解 | 求去除最高、最低分后的平均成绩
select avg(成绩) as 平均成绩 from 成绩表 where 成绩升序排名 > 1 and 成绩降序排名 > 1
2025-11-07
0
9
题解 | 升序降序排名II
select 学号,成绩,rank()over(order by 成绩) as 成绩升序排名, rank()over(order by 成绩 desc) as 成绩降序排名 from 成绩表 order by 成绩 desc
2025-11-07
0
10
题解 | 升序降序排名I
select *,rank()over(partition by 部门编号 order by 薪水) as 薪水升序排名, rank()over(partition by 部门编号 order by 薪水 desc) as 薪水降序排名 from 薪水表
2025-11-06
0
10
题解 | 连续访问记录
with t as (select 用户ID,访问的页面,访问页面时间,lag(访问的页面)over(partition by 用户ID order by 访问页面时间) as 上一次访问页面 from 访问记录表) select 用户ID,访问的页面,访问页面时间 from t where 上一...
2025-11-05
0
11
题解 | 连续访问记录
with t as (select *,lag(访问的页面)over(partition by 用户ID order by 访问页面时间) as 上一次访问页面 from 访问记录表) select 用户ID,访问的页面,访问页面时间 from t where 上一次访问页面 != 访问的页面 o...
2025-11-05
0
11
题解 | 分组后按名字的首字母升序排序
select * from 雇员表 order by 性别,left(名字,1)
2025-11-05
0
10
题解 | 学生成绩排名
select 学号,课程号,成绩,row_number()over(order by 成绩 desc) as 排名 from 成绩表
2025-11-04
0
11
题解 | 销售额TOP30的品牌信息
select 品牌号,品牌名,sum(销售额) as 平台1总销售额 from 品牌表 join 月销售统计表 using(品牌号) where year(月份) = 2019 and 电商平台 = 1 and 品牌号 not in (select 品牌号 from 月销售统计表 where 电商...
2025-11-04
0
10
题解 | 符合销售额的品牌信息
with t as (select 品牌号,品牌名,品类号,date_format(月份,'%Y-%m') as 月份,电商平台,sum(销售额) as 销售额 from 品牌表 join 月销售统计表 using(品牌号) group by 品牌号,品牌名,品类号,月份,电商平台 having 销...
2025-11-03
0
16
题解 | 题目描述写的一坨
select 品牌号,品牌名,品类号,品类名,电商平台,sum(销售额) as 销售额 from 品类表 join 月销售统计表 using(品类号) join 品牌表 using(品牌号) where year(月份) = 2019 group by 品牌号,品牌名,品类号,品类名,电商平台
2025-11-03
0
10
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页