面试遇到的问题

来源:互联网 发布:手机放线软件 编辑:程序博客网 时间:2024/05/21 09:19

题目一:

select t.name,
max(case when t.man_sex='1' then t.c else 0 end) '男',
max(case when t.man_sex='2' then t.c else 0 end) '女' from(
select name,man_sex,count(1) as c from dept_mianshi group by name,man_sex
) t group by name


原创粉丝点击