--结果为NULL则证明为数字 SELECT regexp_replace('-.1','-?[0-9]*(\.[0-9]+)?$','') FROM dual;--正常数字 SELECT regexp_replace('-.1E-3','-?[0-9]*(\.[0-9]+)?(E-?[0-9]+)?$','') FROM dual; --支持科学计数法 --常规用法: select 1 from dual where 1=1 and regexp_replace('-.1','-?[0-9]*(\.[0-9]+)?$','') is null; update table_a t set t.error_message = 'column_a不能转换为数字' where 1=1 and regexp_replace(t.column_a,'-?[0-9]*(\.[0-9]+)?$','') is not null;
Oracle regexp 验证数字
猜你喜欢
转载自blog.51cto.com/baser/2584539
今日推荐
周排行