select 工号,
sum(case 操作 when 1 then 1 else 0 end) as 注册,
sum(case 操作 when 2 then 1 else 0 end) as 注销,
sum(case 操作 when 3 then 1 else 0 end) as 修改,
count(*) as 总和
from table1
group by 工号
order by 工号
sum(case 操作 when 1 then 1 else 0 end) as 注册,
sum(case 操作 when 2 then 1 else 0 end) as 注销,
sum(case 操作 when 3 then 1 else 0 end) as 修改,
count(*) as 总和
from table1
group by 工号
order by 工号
sum(case 操作 when 1 then 1 else 0 end) as 注册,
sum(case 操作 when 2 then 1 else 0 end) as 注销,
sum(case 操作 when 3 then 1 else 0 end) as 修改,
count(*) as 总和
from table1
group by 工号
order by 工号