我有问题。
mysql> SELECT 0 IN ('a',4);
+--------------+
| 0 IN ('a',4) |
+--------------+
| 1 |
+--------------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT 1 IN ('a',4);
+--------------+
| 1 IN ('a',4) |
+--------------+
| 0 |
+--------------+
1 row in set, 1 warning (0.00 sec)
'a'施放为0.如何使'a'没有投射......?
答案 0 :(得分:2)
转换您与字符串进行比较的值:
mysql> SELECT '0' IN ('a', '4');
+-----------------+
| '0' IN ('a', 4) |
+-----------------+
| 0 |
+-----------------+
mysql> SELECT '4' IN ('a', '4');
+-----------------+
| '4' IN ('a', 4) |
+-----------------+
| 1 |
+-----------------+