- 打卡第2天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第1天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第5天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第6天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第4天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第9天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第3天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第8天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第7天 -- 3S2A1P : 三道sql,2道算法,1道简
- 打卡第10天 -- 3S2A1P : 三道sql,2道算法,1道
打卡第11天 -- 3S2A1P : 三道sql,2道算法,1道简答
sql-1
按照dept_no进行汇总,属于同一个部门的emp_no按照逗号进行连接,结果给出dept_no以及连接出的结果employees
-- group_concat()
select dept_no,group_concat(emp_no,",") as employees from dept_emp group by dept_no
sql-2
分页查询employees表,每5行一页,返回第2页的数据
select * from employees limit 5, 5 -- 第一个5 表示从第五个取,第二个5表示取5个
select * from employees limit 5 offset 5 -- 第一个5 表示取5个,第二个5表示从第五个取
sql-3
请你找到每个人的任务情况,并且输出出来,没有任务的也要输出,而且输出结果按照person的id升序排序
select p.id,p.name,t.content from person p left join task t on p.id=t.person_id order by p.id
网友评论