作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/26 16:18:32
(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
isnull(A.SMARBH,'') = (case A.ZT when 1 then 's318' else '' end)