(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.BZBHA.SMARBH =
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/14 23:50: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.BZBHA.SMARBH =](/uploads/image/z/3684649-49-9.jpg?t=%28case+A.ZT+when+1+then+%27s318%27+else+null+end%29SELECT+A.%2A%2CCONVERT%28NVARCHAR%2850%29%2CB.JJRQ%2C23%29+AS+JJRQ+FROM+BXX+A%2CJJD+B+where+A.JJDBH%3DB.JJDBH+and+A.BZBH%3D%27YZ1-81-01%27+and+A.SMARBH+%3D+%28case+A.ZT+when+1+then+%27s318%27+else+null+end%29+ORDER+BY+B.JJRQ%2CA.BZBHA.SMARBH+%3D)
(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.BZBHA.SMARBH =
(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
(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.BZBHA.SMARBH =
isnull(A.SMARBH,'') = (case A.ZT when 1 then 's318' else '' end)