Unexpected output when using a CASE expression
I was trying out some random things using case expression when I stumbled upon this scenario. The first statement throws an error but the second one works fine. Can someone help me understand the execution of CASE expression here.
SELECT CASE WHEN 1 = 1 THEN 'case 1'
WHEN 2 = 2 THEN 2
ELSE 10 END
SELECT CASE WHEN 1 = 1 THEN 1
WHEN 2 = 2 THEN 'case 2'
ELSE 10 END