mysql> SELECT 'A'=1, 'A'=0, 'A'=1234;
+-------+-------+----------+
| 'A'=1 | 'A'=0 | 'A'=1234 |
+-------+-------+----------+
| 0 | 1 | 0 |
+-------+-------+----------+
To explain...
'A' is a string.
0, 1, 1234 are numbers.
'=', in this syntax, is a comparison operator, not an assignment operator.
'=' compares a number with a string as a numeric comparison.
The string is converted to a number. If there are leading digits in the string, those will be converted. If not, then it will be treated as 0.
mysql> SELECT 0=1, 0=0, 0=1234;
+-----+-----+--------+
| 0=1 | 0=0 | 0=1234 |
+-----+-----+--------+
| 0 | 1 | 0 |
+-----+-----+--------+
To explain further...
'=' returns a TRUE/FALSE value.
TRUE is a synonym for 1.
FALSE is a synonym for 0.
If you want to assign a "variable", then use this syntax:
mysql> SELECT @A := 12;
+----------+
| @A := 12 |
+----------+
| 12 |
+----------+
mysql> SELECT @A * @A;
+---------+
| @A * @A |
+---------+
| 144 |
+---------+
Another tidbit of info can be found in the WARNINGS:
mysql> SELECT 'A'=1, 'A'=0, 'A'=1234, '1234xyz'=1234;
+-------+-------+----------+----------------+
| 'A'=1 | 'A'=0 | 'A'=1234 | '1234xyz'=1234 |
+-------+-------+----------+----------------+
| 0 | 1 | 0 | 1 |
+-------+-------+----------+----------------+
1 row in set, 4 warnings (0.01 sec)
mysql> SHOW WARNINGS;
+---------+------+---------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'A' |
| Warning | 1292 | Truncated incorrect DOUBLE value: 'A' |
| Warning | 1292 | Truncated incorrect DOUBLE value: 'A' |
| Warning | 1292 | Truncated incorrect DOUBLE value: '1234xyz' |
+---------+------+---------------------------------------------+