解决方案 »

  1.   

    select
         sum(case when cus_status='未确认'  then 1 else 0 end) as 未确认' ,
         sum(case when cus_status='确认'  then 1 else 0 end) as '确认' ,
         sum(case when cus_status='签约'  then 1 else 0 end) as 签约' ,
         sum(case when cus_status='已放弃'  then 1 else 0 end) as 已放弃' 
    from
          customs
      

  2.   

    select
         sum(case when cus_status='未确认'  then 1 else 0 end) as 未确认' ,
         sum(case when cus_status='确认'  then 1 else 0 end) as '确认' ,
         sum(case when cus_status='签约'  then 1 else 0 end) as '签约' ,
         sum(case when cus_status='已放弃'  then 1 else 0 end) as 已放弃' 
    from
          customs
      

  3.   

    select
         sum(case when cus_status='未确认'  then 1 else 0 end) as 未确认' ,
         sum(case when cus_status='确认'  then 1 else 0 end) as '确认' ,
         sum(case when cus_status='签约'  then 1 else 0 end) as '签约' ,
         sum(case when cus_status='已放弃'  then 1 else 0 end) as '已放弃' 
    from
          customs