Oracle 数据库 如何判断一个字符串是数字

-- 判断是否是数字 
select * from  (select '12'  col1 from dual) where trim(translate(col1,'0123456789',' ')) is NULL;

 

select name
    , case when trim(translate(col1,'0123456789',' ')) is NULL   then  col1 || '是数字'
           else col1 || '不是数字'
      end  remark
    , col1
from t_user 

 

posted @ 2022-08-26 10:41  htj10  阅读(344)  评论(0编辑  收藏  举报
TOP