I’m trying to create a searched case sql statement based on a number of boolean expressions.
For example
select CASE a = b OR c = d OR e = f OR g = h
THEN 'x' ELSE 'y' END
from table_name
I keep getting the following error: Incorrect syntax near '='.
Am I doing something that’s inherently wrong/illegal in sql, or is this something I can fix? If it is fixable, how can I do it?
Thanks!
The format is
CASE..WHEN..THEN..ELSE..END. You were just missing theWHEN.