Home > database >  Seek guidance PLSQL interception field the second or the second and third character how to write?
Seek guidance PLSQL interception field the second or the second and third character how to write?

Time:10-18

Field content as shown in figure, want to extract the j, followed by the Numbers and the Numbers behind/j to follow! O bosses give advice or comments!

CodePudding user response:

Out of the Numbers are as another table number!

CodePudding user response:

The select regexp_replace (' J123.../J321 ahhh ', 'J (\ d +) + J (\ d +) +', '\ 1; 2 \ ') from dual

CodePudding user response:

WITH
T1 AS (
SELECT 'J8 123/J12' S FROM DUAL UNION ALL
SELECT 'J90 98765 J1/' S the FROM DUAL),
T2 AS (SELECT T1. S, TRANSLATE (S, 'J0123456789' | | S, 'J0123456789) SS FROM T1),
T3 AS (SELECT S, SS, SUBSTR (SS, INSTR (SS, 'J') + 1, LENGTH (SS) - 1) SSS FROM T2)
The SELECT T3. S, SUBSTR (SSS, 1, INSTR (SSS, 'J') - 1) S1, SUBSTR (SSS, INSTR (SSS, 'J') + 1, LENGTH (SSS)) S2 FROM T3

CodePudding user response:

Get first place position, behind the interception

CodePudding user response:

Select regexp_substr (' a123bvf ', '[0-9] +') from dual, can only capture consecutive Numbers;
Select regexp_replace (' a123bvf45c ', '[^ 0-9] +') from dual weed out all the figures;
Trip to oh
  • Related