ms sql 聚合事例

select sum(case  when xseventype<>'' then 1 else 0 end), 
       sum(case  when zaeventype<>'' then 1 else 0 end),hotelcode
from info_hotelevent group by hotelcode

 

原文地址:https://www.cnblogs.com/liufei88866/p/1419866.html