I have a 'Text' column in my 'process' table. Text consists of a VARCHAR (220), in this text I need to identify a specific word pattern. In this case a sequence of numbers with a "-" to separate:
'1234-567' - There are 4 digits followed by '-' and soon after 3 Digits;
And before this number there is a word like 'ProNumber:'.
So I tried to use the Substring and Locate function to trace and show the result.
SELECT substring(Texto, locate('ProNumber:', Texto) +11,8) como número FROM processo;
But unfortunately this number appears several times in the 'Text' column field, and my query only shows the first one.
Is there any way to do a query that returns the various numbers that the field contains?
Edited:
I would like the result to be something like:
Process | ProNumber
0001 | 1234-567
0001 | 8945-567
0002 | 1258-567
0003 | 1454-547
0004 | 1548-987
0004 | 1234-567