SQL2000语句,怎么写?

来源:百度知道 编辑:UC知道 时间:2024/06/20 05:25:27
如果select 条码 from a where 条码=1 结果为空,
那么……
请问这样应该怎么写?

select case
when (select 条码 from a where 条码 = 1) is null then
条码
end
from a

if not exists (select 条码 from a where 条码=1 )

if not exists(select *) exists 来判断select结果集

select 条码 from a where 条码='1' ?

select 条码 from a where 条码='1'

if not exists (select 条码 from a where 条码=1 )
这里写那么什么什么的东西。

if not exists(结果集) 表示:如果结果集不存在,则运行以下语句

(你那个语句)=null