I am trying to search for a list of different strings within a table that is constrained on the REGEXP_SUBSTR() function.
What my code below is doing is it removes everything that is contains 'PO:' and that contains 'HF:' and searches for a number (ex: 12345) within the table. I want a quick way to search for multiple numbers (ex; 12345, 12346, 12347...) and not have to use the REGEXP_SUBSTR() function with LIKE each time.
My code:
SELECT column_1, column_2, column_3
FROM table_1
WHERE column_1 NOT LIKE 'PO:%'
AND column_1 NOT LIKE 'HF:%'
AND REGEXP_SUBSTR(column_1, '[0-9]+',1,1) LIKE '%12345%'
;
I have tried 'IN'
AND REGEXP_SUBSTR(column_1, '[0-9]+',1,1) **IN** ('%12345%', '%12346%')
but this doesn't work.
I am new so any help/guidance is much appreciated!