在思考的六边形战士很想去旅行
在思考的六边形战士很想去旅行
全部文章
分类
归档
标签
去牛客网
登录
/
注册
在思考的六边形战士很想去旅行的博客
全部文章
(共90篇)
题解 | 计算总和
# 直接分组聚合再过滤 group by + having select order_num, sum(item_price*quantity) as total_price from OrderItems group by order_num having total_price ...
2025-07-30
1
24
题解 | 返回订单数量总和不小于100的所有订单的订单号
select order_num from ( select order_num, sum(quantity) as total_qt from OrderItems group by order_num ) as s1 where total_qt >= 100 order ...
2025-07-30
1
29
题解 | 每个供应商成本最低的产品
# group by vend_id 和 窗口子句over(partition by vend_id) # 它们的作用、效果是不完全一样的 select vend_id, min(prod_price) as cheapest_item from Products group by...
2025-07-30
1
21
题解 | 顾客登录名
# 返回或提取字符串前n个字符 left(str,n) # 字符串拼接 concat(str1,str2,...) # 字符串字母全部大写化 upper(str) select cust_id, cust_name, upper(concat(left(cust_contac...
2025-07-30
1
22
题解 | 查找入职员工时间升序排名的情况下的倒数第三的员工所有信息
# 同一时期入职的员工可能有多个, # 所以这种先给它按hire_date desc排序,再limit 2,3取一行的方法会有遗漏 # limit一般用在取指定行数的地方(需要选取的行的数量是确定的情况) select emp_no, birth_date, first_n...
2025-07-30
1
21
题解 | 查找最晚入职员工的所有信息
select * from employees order by hire_date desc limit 1;
2025-07-30
1
38
题解 | 浙大不同难度题目的正确率
select qd.difficult_level, round( sum( case when qpd.result = 'right' then 1 else 0 ...
2025-07-18
1
28
题解 | 统计复旦用户8月练题情况
# 为什么在where子句限制日期(同样的qpd.date between '2021-08-01' and '2021-08-31')会出现遗漏,求解答 select up.device_id, up.university, count(qpd.question_id) a...
2025-07-18
1
35
题解 | 计算用户的平均次日留存率
# 经典方法+1 select round(sum(case when p2.device_id is not null then 1 else 0 end)/count(*), 4) as avg_ret from (select distinct device_id, date ...
2025-07-18
1
45
题解 | 21年8月份练题总数
select count(distinct device_id) as did_cnt, count(question_id) as question_cnt from question_practice_detail;
2025-07-16
1
30
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页