列改行排列

    技术2022-05-20  39

    select year, a, b, c, a+b+c from(  select year,sum(decode(type,1,count,0)) a,sum(decode(type,2,count,0)) b,sum(decode(type,3,count,0)) c  from   (  select t.st_award_year year,t.St_Type type,count(*) count  from er_recognition_info t  where t.st_deleted = '0'  group by t.st_type,t.st_award_year  ) t  group by year  order by year)


    最新回复(0)