马杀鸡
马杀鸡
全部文章
分类
归档
标签
去牛客网
登录
/
注册
马杀鸡的博客
全部文章
(共11篇)
题解 | 统计所有课程参加培训人次
select sum(length(course)-length(replace(course,",",""))+1) as staff_nums from cultivate_tb where course is not null 新的知识点哈1.len...
2025-12-01
0
23
题解 | 获取指定客户每月的消费额
select date_format(t.t_time,'%Y-%m') as time, round(sum(t.t_amount),1) as total from trade t join customer c on t.t_cus = c.c_id where c.c_name ...
2025-11-25
0
23
题解 | 分析客户逾期情况
select c.pay_ability, concat(round(sum(case when l.overdue_days is not null then 1 else 0 end)/count(*)*100,1),'%') as overdue_ratio from loan_tb l ...
2025-11-24
0
22
题解 | 下单最多的商品
select p.product_id,count(u.product_id) as cnt from product_info p join user_client_log u on p.product_id = u.product_id where u.step = "order&...
2025-11-21
0
26
题解 | 查询成绩
select count(*) from( select s.sid,sum(SC.score) as sum_SC from Student s join SC on s.sid = SC.sid join Course c on SC.cid =...
2025-11-20
0
20
题解 | 商品交易(网易校招笔试真题)
select g.id, g.name,g.weight,sum(t.count) as total from goods g join trans t on g.id = t.goods_id group by g.id having sum(t.count)>20 and wei...
2025-11-20
0
30
题解 | 统计各个部门平均薪资
select st.department ,round(avg(sa.normal_salary-sa.dock_salary),3) as avg_salary from staff_tb st join salary_tb sa on st.staff_id = sa.staff_id wh...
2025-11-20
0
26
题解 | 查询单日多次下订单的用户信息?
/* 日期+用户分组,统计数量 会员信息在前面的查询中用不到,可以放在最外层匹配 */ select day_table.order_date ,day_table.user_id,day_table.order_nums,u.vip from ( select DATE_FORMAT(ord...
2025-11-20
0
19
题解 | 统计用户获得积分
SELECT user_id, SUM( CASE WHEN TIMESTAMPDIFF(MINUTE, visit_time, leave_time) < 0 THEN 0 ELSE FLOOR(TIMEST...
2025-11-20
0
23
题解 | 统计员工薪资扣除比例
select sta.staff_id,sta.staff_name,concat(round((sal.dock_salary/sal.normal_salary)*100,1),'%') as dock_ratio from staff_tb sta join salary_tb sal on...
2025-11-20
0
23
首页
上一页
1
2
下一页
末页