(case A.ZT when 1 then 's318' else null end)

问题描述:

(case A.ZT when 1 then 's318' else null end)
SELECT A.*,CONVERT(NVARCHAR(50),B.JJRQ,23) AS JJRQ FROM BXX A,JJD B where A.JJDBH=B.JJDBH and A.BZBH='YZ1-81-01' and A.SMARBH = (case A.ZT when 1 then 's318' else null end) ORDER BY B.JJRQ,A.BZBH
A.SMARBH = (case A.ZT when 1 then 's318' else null end) 这种查询出不来结果 else null 这可能不对吧
如果a.zt=1的时候 条件为 a.smarbh='s318' 如果 a.zt=0的时候 条件为 a.smarbh is null
1个回答 分类:综合 2014-11-03

问题解答:

我来补答
isnull(A.SMARBH,'') = (case A.ZT when 1 then 's318' else '' end)
 
 
展开全文阅读
剩余:2000
上一页:一道物理提题