
sql的if语句如果不是数值的结果,怎样判断布尔值
这个程序怎么进行布尔值判断ALTERprocedurechaxuna@table2_idoint,@table2_snamevarchar(20),@table2_sex...
这个程序怎么进行布尔值判断
ALTER procedure chaxuna @table2_ido int, @table2_sname varchar (20), @table2_sex char (10)
if @table2_ido is null and @table2_sname is null and @table2_sex is null
begin
select *
from table2
end
else
select *
from table2
where ido=@table2_ido or sname=@table2_sname or sex=@table2_sex
无尽感谢 展开
ALTER procedure chaxuna @table2_ido int, @table2_sname varchar (20), @table2_sex char (10)
if @table2_ido is null and @table2_sname is null and @table2_sex is null
begin
select *
from table2
end
else
select *
from table2
where ido=@table2_ido or sname=@table2_sname or sex=@table2_sex
无尽感谢 展开
2个回答
展开全部
用isnotnull来判断,即if isnotnull **,这个**就是你要判断的东西.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询