存储过程中的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
posted on 2009-07-09 14:00  prayforsmile  阅读(425)  评论(0编辑  收藏  举报