• Since SQL does not have a CASE statement, but does have a CASE expression, the answer depends on the interpretation of the question.

    Are we supposed to assume that the question's author is one of the many people that don't know the difference between statements and expression? In that case, the answer is of course "yes" - but I really don't see why such a simple question would be worth 2 points.

    Or are we supposed to answer "no", because a CASE statement doesn't exist in SQL at all, and hence can't be used anywhere, including a WHERE clause? In that case, I think the category should have been "nitpicking" instead of "T-SQL".

    Since both interpretations of the question are equally valid (or rather: equallly invalid) and the points and category don't help to indicate which interpretation is the most likely, I've decided to skip this question. If the wording of the question gets changed, I'll revisit it.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/