oracle里面怎么字符串轉成number?
WITH t AS (SELECT 'abcdefghijklmn' AS a FROM dual UNION ALL SELECT 'abcdefgh' AS a FROM dual UNION ALL SELECT 'abcd' AS a FROM dual) SELECT CASE WHEN length(lpad(t.a, 8, '0')) = 8 THEN lpad(t.a, 8, '0'
) ELSE substr(t.a, 1, 8) END AS a FROM t