mysql自动带空格拆分关键字

ie3xauqp  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(333)

我有一张table叫 members ```
+----+--------+--------+-------+--+
| id | name | gender | state | |
+----+--------+--------+-------+--+
| 1 | Peter | M | 1 | |
+----+--------+--------+-------+--+
| 2 | Sally | F | 1 | |
+----+--------+--------+-------+--+
| 3 | Martin | M | 0 | |
+----+--------+--------+-------+--+

那么,我的问题是

SELECT * FROM member WHERE id = '1 3';

mysql返回 `| 1 | Peter | M | 1 | |` .
但是,我希望它不会返回任何结果,因为不应该有 `id = '1 3'` .
我怎样才能防止这种情况?
ff29svar

ff29svar1#

尝试使用 BINARY ```
select * from member where BINARY id = '1 3';

相关问题