mysql中判断字段是否是数字

#查询出数据则为数字
select * from standard_csbi_service_tree_1d_full where length(0+‘b123’)=length(‘b123’);
例子:
select name,name+0,userid,userid+0 from wxc;
name name+0 userid userid+0
f 0 5 5
e 0 5 5
c 0 3 3
c 0 5 5
#查询speed列不是数字的数据
select * from standard_csbi_service_tree_1d_full where (‘2134’ REGEXP ‘[^0-9.]’)=1;
#查询speed列是数字的数据
select * from standard_csbi_service_tree_1d_full where (speed REGEXP ‘[^0-9.]’)=0;

你可能感兴趣的:(mysql)