1、表数据
2、公式查询后
3、SQL语法
WITH A AS (
SELECT '1' AS ri, '加3' AS XXX from dual
UNION ALL
SELECT '2' AS ri, '' AS XXX from dual
UNION ALL
SELECT '3' AS ri, '' AS XXX from dual
UNION ALL
SELECT '4' AS ri, '' AS XXX from dual
)
--SELECT ri,REGEXP_SUBSTR(XXX,'[0-9]+') AS sz FROM A;
SELECT ri,XXX,REGEXP_SUBSTR(XXX,'[0-9]+') AS sz ,
CASE WHEN ri <= (SELECT SUM(REGEXP_SUBSTR(XXX,'[0-9]+')) from A) THEN '加1'
ELSE NULL END XXX1
FROM A;