1
mysql> select 'ab' like 'a_%';
+-----------------+
| 'ab' like 'a_%' |
+-----------------+
| 1 |
+-----------------+
1 row in set (0.00 sec)
mysql> select 'ab' like 'a\_%';
+------------------+
| 'ab' like 'a\_%' |
+------------------+
| 0 |
+------------------+
1 row in set (0.00 sec)
mysql> select 'a_b' like 'a\_%';
+-------------------+
| 'a_b' like 'a\_%' |
+-------------------+
| 1 |
+-------------------+
1 row in set (0.00 sec)
爲什麼我需要逃脫_
?爲什麼在MySQL中_特別?
一個谷歌搜索「的MySQL像下劃線」會找到你想要的,你的信息。 (甚至只是「mysql下劃線」。) –