I would like to write an SQL statement with a CASE WHEN clause that uses the LIKE operator but I am not sure how to properly format the statement.
SELECT
services.id,
(CASE services.description
WHEN LIKE '%-'
THEN services.amount * -1
ELSE services.amount
END) AS service_amount
FROM services
Try it on this way:
SELECT
services.id,
CASE WHEN services.description LIKE '%-'
THEN services.amount * -1
ELSE services.amount
END) AS service_amount
FROM services