11g版本:
- WITHtAS
- (
- SELECT'((:1*:1)+:2)/:10'col
- FROMdual
- UNIONALL
- SELECT'((:3*:0)+:323)/:1213lse12lj'FROMdual
- )
- SELECTcol,
- regexp_substr(col,
- '[0-9]+',
- 1,
- LEVEL)ASdd,
- LEVELASposition
- FROMt
- CONNECTBYLEVEL<=regexp_count(col,
- '[0-9]+')AND
- PRIORdbms_random.VALUEISNOTNULLAND
- PRIORcol=col
- ORDERSIBLINGSBYcol;
10g版本:
原文链接:https://www.f2er.com/regex/363040.html
- WITHtAS
- (
- SELECT'((:1*:1)+:2)/:10'col
- FROMdual
- UNIONALL
- SELECT'((:3*:0)+:323)/:1213lse12lj'FROMdual
- )
- SELECTcol,
- LEVELASposition
- FROMt
- CONNECTBYLEVEL<=(length(regexp_replace(col,
- '[0-9]+',
- '~~~'))-
- length(REPLACE(regexp_replace(col,
- '[0-9]+',
- '~~~'),
- '~~~')))/3AND
- PRIORdbms_random.VALUEISNOTNULLAND
- PRIORcol=col
- ORDERSIBLINGSBYcol;