当前位置: 代码迷 >> Sql Server >> 怎么在where中使用case when
  详细解决方案

怎么在where中使用case when

热度:77   发布时间:2016-04-27 21:15:12.0
如何在where中使用case when?
CASE   WHEN
          a.PageType= 'Cate '   AND   a.CurrFolder   IS   NULL  
THEN   a.Cateid   =   34
ELSE   a.id   =   33
END

------解决方案--------------------
where (CASE WHEN
a.PageType= 'Cate ' AND a.CurrFolder IS NULL
THEN a.Cateid
ELSE a.id +1
END ) =34
  相关解决方案