【发布时间】:2018-12-19 04:40:12
【问题描述】:
我正在做一些系统测试,并期望 MySQL(5.7.21) 的结果为空,但得到结果感到惊讶。
我的交易表如下所示:
Column Data type
----------------------------
id | INT
fullnames | VARCHAR(40)
---------------------------
我有一些记录
--------------------------------
id | fullnames
--------------------------------
20 | Mutinda Boniface
21 | Boniface M
22 | Some-other Guy
-------------------------------
我的示例查询:
select * from transactions where id = "20"; -- gives me 1 record which is fine
select * from transactions where id = 20; -- gives me 1 record - FINE as well
现在,当我尝试这些时,它变得很有趣:
select * from transactions where id = "20xxx"; -- gives me 1 record - what is happening here?
MySQL 在这里做什么??
【问题讨论】:
标签: mysql sql database select type-conversion