select *from table_namewhere isnumeric(field_name) = 0 or (charindex('.',field_name) > 0 and isnumeric(field_name) = 1 and floor(field_name) ceiling(field_name))其中field_name是nvarchar类型的,floor()和ceiling()括号里的要求是numeric类

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 19:13:43
select*fromtable_namewhereisnumeric(field_name)=0or(charindex(''.'',field_name)>0andisnumeric(field_na

select *from table_namewhere isnumeric(field_name) = 0 or (charindex('.',field_name) > 0 and isnumeric(field_name) = 1 and floor(field_name) ceiling(field_name))其中field_name是nvarchar类型的,floor()和ceiling()括号里的要求是numeric类
select *
from table_name
where isnumeric(field_name) = 0 or (charindex('.',field_name) > 0 and isnumeric(field_name) = 1 and floor(field_name) ceiling(field_name))
其中field_name是nvarchar类型的,floor()和ceiling()括号里的要求是numeric类型的,会出问题的,

select *from table_namewhere isnumeric(field_name) = 0 or (charindex('.',field_name) > 0 and isnumeric(field_name) = 1 and floor(field_name) ceiling(field_name))其中field_name是nvarchar类型的,floor()和ceiling()括号里的要求是numeric类
不可能出问题的,where条件是有执行顺序的.如果isnumeric(field_name) = 0成立也就是说不是数字的话,or后面的语句是不会被执行的,也就谈不上floor里要求什么值了.