select CNAME=case when CNAME is null then '4' else '1' end from SMPTEL where SMPTEL.Newtel='1585'select CNAME=case when CNAME is null then '456' else '123' end from SMPTEL where SMPTEL.Newtel='158'Newtel 没有158 如何让其显示 456现在
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/25 12:26:43
select CNAME=case when CNAME is null then '4' else '1' end from SMPTEL where SMPTEL.Newtel='1585'select CNAME=case when CNAME is null then '456' else '123' end from SMPTEL where SMPTEL.Newtel='158'Newtel 没有158 如何让其显示 456现在
select CNAME=case when CNAME is null then '4' else '1' end from SMPTEL where SMPTEL.Newtel='1585'
select CNAME=case when CNAME is null then '456' else '123' end from SMPTEL where SMPTEL.Newtel='158'
Newtel 没有158 如何让其显示 456
现在什麽都没有
select CNAME=case when CNAME is null then '4' else '1' end from SMPTEL where SMPTEL.Newtel='1585'select CNAME=case when CNAME is null then '456' else '123' end from SMPTEL where SMPTEL.Newtel='158'Newtel 没有158 如何让其显示 456现在
select CNAME=case when CNAME is null then '456' else '123' end from SMPTEL where SMPTEL.Newtel='158'
union all
select '456' where not exists(select 1 from smptel where newtel='158'
如果是oracle就在where前加上from dual,如果是db2就加上from sysibm.sysdummy1