如何转换字符串字段并用于Where子句。我遇到这样的异常,请帮助找到错误的东西。
select * from student
where (cast (nvl(linerevnum,'0') as int)) = 1
linerevnum 是 varchar2
例外 :
无效号码
仅当 是数字时比较
select * from student
where
(
case when ISNUMERIC( linerevnum )
then cast (linerevnum as int)
else null
end ) = 1
或简单:
select * from student
linerevnum = '1'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)