As a concise example of the evils of type coercion I came up with the following: INSERT INTO t VALUES ( CAST(2 AS INT), CAST(2 AS INT)); SELECT CASE WHEN x + z = 4 THEN '4' ELSE 'NOT 4' END xPLUSz FROM t; Result: xPLUSz ------ NOT 4 It is left as an exercise
Read More...