Hello, I'm after some help please.
I have a field in my database called 'reference_code' for blog I'm creating.
In the field in each record I have reference codes which
1- contain a
: character Between each alphanumeric value
2- There are a min number of 1 of values between each starting and ending : and a maximum of 4
3- They Are followed by a four digit alphanumeric code, So in each record the field for 'code' could look like:
This
Or this
Or this
Or this
Code:
:RA1F:52FA:3FG1:ASD3:
In the field 'code' - and the code needs to be like this, so it's not a case of normalising my database here.
Now my question is this, is there any way I can explode on the
: character and alias that one column into four just extracting each code individually? I've tried it using SUBSTRING_INDEX, but can't work it out.
Thank you