56,677
社区成员
发帖
与我相关
我的任务
分享
SELECT *
FROM `a`
WHERE `name` LIKE '%\\\\%'
mysql>
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> DROP TABLE a;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE a SELECT 1 AS id, "ds\\' f5" AS NAME;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> INSERT INTO a SELECT 2 , "ac\\' f6";
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from a;
+----+---------+
| id | NAME |
+----+---------+
| 1 | ds\' f5 |
| 2 | ac\' f6 |
+----+---------+
2 rows in set (0.00 sec)
mysql> SELECT * FROM `a` WHERE `name` LIKE "%\\\%";
+----+---------+
| id | NAME |
+----+---------+
| 1 | ds\' f5 |
| 2 | ac\' f6 |
+----+---------+
2 rows in set (0.00 sec)
mysql>