我想知道是否有可能用另一個字符串加位置替換特定字符串而不使用PL/SQL塊(循環,用戶定義函數/存儲過程,帶函數構造...)。替換字符串與另一個字符串加上各自的位置
這裏:st
- >pos_num
輸入:
"aa bbb st cccc dddd st eeeeeeeeeee ffff g st g h i st j k l m st"
輸出:
"aa bbb pos_1 cccc dddd pos_2 eeeeeeeeeee ffff g pos_3 g h i pos_4 j k l m pos_5"
我覺得這是有可能實現它的Wi第一行操作(也許是正則表達式)。
是。可能與'REGEXP_INSTR','REGEXP_REPLACE'和'LEVEL'組合。 –
是一個遞歸的cte好嗎?或者你更喜歡只有一個班輪:)? –
@VamsiPrabhala隨時發佈您的解決方案:)一行優雅的解決方案是首選,但不是必要的:) – lad2025