牛码er
牛码er
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛码er的博客
全部文章
(共6篇)
题解 | 各个部门实际平均薪资和男女员工实际平均薪资
select department ,round(sum(s1.normal_salary-s1.dock_salary)/count(*),2) as average_actual_salary ,round(coalesce(sum(case when s.staff_gender='male...
2025-12-16
0
18
题解 | 统计借阅量
with t as (select t.book_id, t.book_title, sum(case when date_format(t1.borrow_date,'%Y-%m')='2023-02' then 1 else 0 end) feb_2023_borrows, sum(case ...
2025-12-15
0
14
题解 | #推荐内容准确的用户平均评分#
select sum(score)/count(user_id) from (select t2.user_id,t2.score from recommend_tb t1 inner join user_action_tb t2 on t1.rec_user=t2.user...
2024-11-02
3
102
题解 | #分析客户逾期情况#
select pay_ability, concat(round(sum(flg)/sum(rs)*100,1),'%')as overdue_ratio #MySQL的某些版本中,如果启用了 PIPES_AS_CONCAT SQL模式,|| 将被视为OR运算符导致结果错误,最好用concat拼接...
2024-11-02
0
138
#获取当前薪水第二多的员工emp_no及薪水salary#
select a.emp_no, a.salary, b.last_name, b.first_name from salaries a inner join employees b on a.emp_no=b.emp_no and a.to_date='9999-01-01' and a.emp...
2024-10-26
0
66
题解 | #查找在职员工自入职以来的薪水涨幅情况#
select a.emp_no,(c.salary-b.salary) as growth from employees a left join salaries b on a.emp_no=b.emp_no and a.hire_date =b.from_dat...
2024-10-25
0
142