1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] SQL Query with REGEXP [closed]

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 27, 2021.

  1. Stack

    Stack Membro Participativo

    I have data in one row and would like to capture all the strings that starts with A- and CMB and display every record in a row also. I put it in excel to be understandable https://docs.google.com/file/d/1L_l...UJmiyd/edit?usp=docslist_api&filetype=msexcel

    I queried it this way but it does not work.
    SELECT
    DBMS_LOB.SUBSTR(Table_1.Data_File, 3000,1) as Data_File,
    REGEXP_EXP(DBMS_LOB.SUBSTR(Table_1.Data_File, 3000,1),'^A-.+|^CMB.+') as Case_Number
    FROM Table_1

    Here’s the Data inside the row
    A-123456789
    B-Anything
    A-123456780
    B-Anything
    CMB987654321
    A-123456781
    B-Anything
    CMB987654322
    B-Anything
    CMB987654323

    I would like the result to be:
    Data_File Case_Number
    Data inside the row 123456789
    Data inside the row 123456780
    Data inside the row 123456781
    Data inside the row 987654321
    Data inside the row 987654322
    Data inside the row 987654323

    Continue reading...

Compartilhe esta Página