Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何转换字符串字段并用于 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'