I need a hand to solve a problem with my column field. I need to extract the string in between these two different "patterns" of strings for example:
[...string] contract= 1234567890123350566076070666 issued= [string ...]
I want to extract the string in between 'contract=' and 'issued='
At the present moment I'm using
SELECT substring(substring_index(licence_key,'contract=',-1),1,40) FROM table
The problem is that this string in between doesn't have always 40 characters so it's not fixed length and so the data that comes before and after that. It's a volatile data.
Do you known how I can handle that?
Just use
substring_index()
twice:If this string does not match then give the total result.
If you want to replace then you can use like this.