遇到一个批量更新的需求,我打算用内联视图更新+where in list的技巧处理。
UPDATE (
SELECT /*+ BYPASS_UJVC */ *
FROM mvbox_space.music_original t1
INNER JOIN (
SELECT REGEXP_SUBSTR(value_str, '[^,]+', 1, 1) AS p1, REGEXP_SUBSTR(value_str, '[^,]+', 1, 2) AS p2
FROM (
SELECT SUBSTR(inlist, INSTR(inlist, ';', 1, LEVEL) + 1, INSTR(inlist, ';', 1, LEVEL + 1) - INSTR(inlist, ';', 1, LEVEL) - 1) AS value_str, level AS l
FROM (
SELECT ';' || '20077,1;20078,2' || ';' AS inlist
FROM DUAL
)
CONNECT BY LEVEL