In the Explanation: "A CASE expression will always evaluate the WHEN clauses from top to bottom. As soon as one evaluates to True, the corresponding [ELSE] is returned."
I think it should be the corresponding [THEN] not else, correct me if I am wrong.
And many thanks to SSC editors who put those 2 nice questions back to back to get the most benefit out of it.
Regards,
Hany Helmy
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant