Grandfathered Database, worst non normal form data I’ve ever witnessed. So queries become a pain the arse.
I’m trying to match to see if the field is NOT either of these two strings..I’ve googled my arse off and the REGEXP function isn’t all that great.
IF (SUBSTRING_INDEX(op.field_name, '-', 1) != ('CAT','DOG'),
ps.products_productline ,SUBSTRING_INDEX(op.fieldname, '-',
1)) AS product_type
The substring index are either Cat, Dog or a Unique string.
Another solution