SELECT TO_CHAR(X.CELLUNITEC) CELL_UNITEC,
NVL(SUBSTR(X.SPEC, 1, INSTR(X.SPEC, '*') - 1), X.SPEC) EC_UNIT
FROM T_SCM_MATERIAL X
WHERE REGEXP_LIKE(X.SPEC, '^[[:alpha:]]+$') --446
UNION ALL
SELECT TO_CHAR(R.CELLUNITEC), R.ECUNIT --6055
FROM T_SCM_MATERIAL R
WHERE R.SPEC IS NULL
UNION ALL
SELECT TO_CHAR(REGEXP_SUBSTR(NVL(SUBSTR(T.SPEC, 1, INSTR(T.SPEC, '*') - 1),
T.SPEC),
'^[[:digit:]]{0,}(\.|-|/){0,}[[:digit:]]{0,}')) CELL_UNITEC,
REGEXP_REPLACE(NVL(SUBSTR(T.SPEC, 1, INSTR(T.SPEC, '*') - 1), T.SPEC),
'^[[:digit:]]{0,}(\.|#|-){0,}[[:digit:]]{0,}',
'') EC_UNIT
FROM T_SCM_MATERIAL T
WHERE NOT REGEXP_LIKE(T.SPEC, '^[[:alpha:]]+$'); --1860
SQL
最新推荐文章于 2024-05-28 21:12:14 发布