62,046
社区成员
发帖
与我相关
我的任务
分享
declare @test Table
(
profession NVARCHAR(15)
)
insert into @test(profession) values('硕士')
insert into @test(profession) values('硕士')
insert into @test(profession) values('硕士')
insert into @test(profession) values('本科')
insert into @test(profession) values('专科')
insert into @test(profession) values('高中')
insert into @test(profession) values('初中')
insert into @test(profession) values('小学')
select COUNT(*),case profession
when '硕士' then '硕士'
when '本科' then '本科'
when '专科' then '专科'
else '其它' end
from @test
group by
case profession
when '硕士' then '硕士'
when '本科' then '本科'
when '专科' then '专科'
else '其它' end