muchenfeng
muchenfeng
全部文章
分类
归档
标签
去牛客网
登录
/
注册
muchenfeng的博客
全部文章
(共40篇)
将所有to_date为9999-01-01全部更新为NULL
update titles_test set to_date =NULL , from_date ="2001-01-01" where to_date = "9999-01-01"
2024-11-11
0
59
给出employees表中排名为奇数行的first_name
select first_name first from( select first_name ,row_number()over(order by first_name )rn from employees order by emp_no )t where rn % 2 =1
2024-11-11
0
49
题解 删除emp_no重复的记录,只保留最小的id对应的记录
delete from titles_test where id not in( select id from ( select * ,row_number()over(partition by emp_no order by id asc) rn from titles_test )t w...
2024-11-11
0
53
题解 | #创建一个actor_name表#
create table actor_name as select first_name, last_name from actor
2024-11-11
0
51
题解 | 使用子查询的方式找出Action类别的电影对应信息
select title,description from film where film_id in ( select fc.film_id from film_category fc join category cy using(category_id) whe...
2024-11-09
0
47
题解 | #汇总各个部门当前员工的title类型的分配数目#
select de.dept_no,ds.dept_name,ts.title,count(1) as count from dept_emp de join departments ds using(dept_no) join titles ts using(emp_no) group...
2024-11-09
0
38
获取员工其当前的薪水比其manager当前薪水还高的相关信息
select t1.emp_no ,t2.emp_no ,t1.salary as emp_salary ,t2.salary as manager_salary from( select emp_no ,dept_no ,salary from dept_emp join salaries u...
2024-11-09
0
41
题解 | #获取所有非manager员工当前的薪水情况#
select dp.dept_no, es.emp_no,s.salary from employees es join dept_emp dp using(emp_no) join salaries s using(emp_no) where emp_no not in (sel...
2024-11-09
0
36
题解 对所有员工的薪水按照salary降序进行1-N的排名
select emp_no , salary,dense_rank()over(order by salary desc) t_rank from salaries order by t_rank ,emp_no
2024-11-09
0
36
题解 | #统计各个部门的工资记录数#
select dt.dept_no,dept_name,count(*) as 'sum' from departments dt join dept_emp dp using(dept_no) join salaries s using(emp_no) group by dt.dept_n...
2024-11-09
0
35
首页
上一页
1
2
3
4
下一页
末页