How do i use the like operator in a case select for Postgres SQL? How do i use the like operator in a case select for Postgres SQL? postgresql postgresql

How do i use the like operator in a case select for Postgres SQL?


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