Sample Header Ad - 728x90

SQL QUESTION_Case When + LIKE %

-2 votes
1 answer
53 views
I get an error but I don´t understand why. Does this make sense in SQL? I need the column ValidNaming to be filled with False/True if the customer (or field CommonLastName) has an invalid name. Why this is not working?
Select
CommonLastName,
CASE COMMONLASTNAME
     WHEN ((CommonLastName like 'Connect%')
     OR (CommonLastName = 'Unknown', '', 'Null')) THEN 'False'
     ELSE 'True'
END ValidNaming,
FROM [DA1]
:( Thanks for any help
Asked by Marina Olaechea (1 rep)
Nov 16, 2021, 08:48 AM
Last activity: Nov 16, 2021, 09:27 AM