首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么在where中使用case when

2012-01-19 
如何在where中使用case when?WHERECASEWHENa.PageType CateANDa.CurrFolderISNULLTHENa.Cateid34ELSEa.i

如何在where中使用case when?
WHERE
CASE   WHEN
          a.PageType= 'Cate '   AND   a.CurrFolder   IS   NULL  
THEN   a.Cateid   =   34
ELSE   a.id   =   33
END

[解决办法]
where 里面 case when 是啥意思?
[解决办法]
Oracle支持这种语法,好像Sql Server不支持(不确定)。

在select语句里

select case when ??? then ???, case when ??? then ???,... from *** where ...

热点排行