select
    [编号],
    sum(case 状态 when 0 then 1 else 0 end) as [记录个数(0态)],
    0 as [状态(0态)],
    sum(case 状态 when 1 then 1 else 0 end) as [记录个数(1态)],
    1 as [状态(1态)]
from 
    表
grooup by
    [编号]