I would like to return a value based on the contents of a column in a mysql table.
example: if ‘newsletter’ = 1 return “Subscriber” else “not subscribed”
I tried with this syntax :
SELECT `id_customer`, `email`, `firstname`, `lastname`, `birthday`,
CASE WHEN `newsletter`=1 THEN "Abonné" ELSE "Non Abonné" END
FROM `"._DB_PREFIX_."customer`
ORDER BY `lastname` ASC
And it does absolutely not work.
A little help please?
Try to use