Oracle数据库,利用正则表达式判断字符串是否全是数字;
--------------- regexp_like(需要判断的字段名,'^+?[1-9][0-9]*$') SELECT ID, PERIODSID, (case when regexp_like(LEADERNUM,'^+?[1-9][0-9]*$') then TO_NUMBER(LEADERNUM) else 0 end) LEADERNUM from EXOA.T_week_meeting
--------------- regexp_like(需要判断的字段名,'^+?[1-9][0-9]*$') SELECT ID, PERIODSID, (case when regexp_like(LEADERNUM,'^+?[1-9][0-9]*$') then TO_NUMBER(LEADERNUM) else 0 end) LEADERNUM from EXOA.T_week_meeting