摘錄:https://www.linuxidc.com/Linux/2012-06/62894.htm
case when 條件 then 條件為真時的值 else 條件為假時的值 end
--單獨查詢統一某個字段等於某值的次數
select count(m.underwriteflag) from prpcmain m where m.underwriteflag='1' ; --720407
select count(m.nationflag) from prpcmain m where m.nationflag='1' --720422
--合並查詢
select count(case when m.underwriteflag='1' then 1 end)字段1,count(case when m.nationflag='1' then 1 end)字段2 from prpcmain m;