I am aware of the existence of the RLIKE
and REGEX
operators, but it seems like they cannot be used for that.
Is there a function or an operator that would help me achieve splitting a text field and selecting it as two or more separate fields:
SELECT $1 as `field_a`, $2 as `field_b` FROM `table` WHERE `field` RLIKE '^(.+):(.+)$';
I am writing a log analyzer so it would be very handy to do that in SQL without additional text-crunching.