1. 表格内容
2. 分组查询,查出各部门人数,以及各部门员工姓名
select edept,count(*),group_concat(ename) from emp_info a group by edept;
3. 分组查询,查出各部门人数,以及各部门员工姓名,salary,kpi
查询1:
select edept,count(*),group_concat(ename,salary,kpi) from emp_info a group by edept;
结果1:
查询2:
select edept,count(*),group_concat(ename," ",salary," ",kpi) from emp_info a group by edept;
结果2: