I want to use a CASE statement that uses REGEXP. Currently I am doing something like this:
SELECT `date_of_sale`,
CASE
WHEN `date_of_sale` regexp '[0-9]*-[0-9]*-[0-9]*' then str_to_date(`date_of_sale`, '%m-%d-%Y')
ELSE
`date_of_sale`
END
FROM <TABLE_NAME>
It will gives an error as bellow
How to solve this