I'm trying to use a case statement to return a specific value.
Of course when myField is NULL I'm getting 'NotListed' because of the inability to compare NULL. Is there a way to do this with a comparitive SQL statement like this, or do I have to resort to
Thanks.
Code:
CASE myField WHEN NULL THEN 'FieldIsNull' WHEN 'A' THEN 'AValue' WHEN 'B' THEN 'BValue' ELSE 'NotListed' END
Code:
CASE WHEN myField IS NULL THEN 'FieldIsNull' WHEN myField = 'A' THEN 'AValue' WHEN myField = 'B' THEN 'BValue' ELSE 'NotListed' END