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
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/archive/2009/03/23/1419866.html