Here is a table Numbers:
+--+--+--+
|A |B |C |
+--+--+--+
|1 |1 |1 |
|1 |2 |1 |
|2 |2 |2 |
|3 |2 |1 |
|3 |3 |3 |
+--+--+--+
Now executing the query:
SELECT CASE WHEN (A = B = C) THEN "Equal" ELSE "Not Equal" END AS Equality FROM Numbers;
gives the output as:
+----------+
|Equality |
+----------+
|Equal |
|Not Equal |
|Not Equal |
|Not Equal |
|Not Equal |
+----------+
But executing the query:
SELECT CASE WHEN (A = B AND B = C AND C = A) THEN "Equal" ELSE "Not Equal" END AS Equality FROM Numbers;
gives the output as:
+----------+
|Equality |
+----------+
|Equal |
|Not Equal |
|Equal |
|Not Equal |
|Equal |
+----------+
Why isn't A = B = C treated the same as A = B AND B = C AND C = A here?
Is this a MySQL thing or an issue with Case When Statement, where applying two operators won't work properly?