存储过程中的case的应用
select
case when Ad.IsClicked=0 then 'impression' else 'click ' end as 'IsClicked',
count(*)
from dbo.T_IMeetADHit Ad
where Ad.ADName='hilton tile'
and Ad.CreateDateTime>='2009-4-1 0:0:0'
and Ad.CreateDateTime<'2009-5-1 0:0:0'
group by Ad.IsClicked
case when Ad.IsClicked=0 then 'impression' else 'click ' end as 'IsClicked',
count(*)
from dbo.T_IMeetADHit Ad
where Ad.ADName='hilton tile'
and Ad.CreateDateTime>='2009-4-1 0:0:0'
and Ad.CreateDateTime<'2009-5-1 0:0:0'
group by Ad.IsClicked