select isnull(序号,0) as 序号 from 系统_密码表 where 单位=8 and 密码='333'
而下面这个就可以返回“0”:
declare @xuhao int
select @xuhao=序号 from 系统_密码表 where 单位=8 and 密码='333'
select isnull(@xuhao,0) as 序号
有点糊涂,请高手指教一下!
...全文
1046打赏收藏
一个有关isnull函数的小问题
为什么下面的sql语句没有返回任何结果: select isnull(序号,0) as 序号 from 系统_密码表 where 单位=8 and 密码='333' 而下面这个就可以返回“0”: declare @xuhao int select @xuhao=序号 from 系统_密码表 where 单位=8 and 密码='333' select isnull(@xuhao,0) as 序号 有点糊涂,请高手指教一下!