实际上“状态”列中不存在以下值(即 1ooo,1ee)”,但结果正在发送。状态列仅包含一 strip 有 1 的记录。
QRY-1:select * from User_Table where key ='xxxxxxxxxxxxxxxxxxxxxxxxx' and status=1;
QRY-2:select * from User_Table where key ='xxxxxxxxxxxxxxxxxxxxxxxxx' and status="1";
QRY-3:select * from User_Table where key ='xxxxxxxxxxxxxxxxxxxxxxxxx' and status="1ooo";
QRY-4:select * from User_Table where key ='xxxxxxxxxxxxxxxxxxxxxxxxx' and status="1ee";
QRY-1:好的
对于上面的 QRY-2、QRY-3、QRY-4 我也得到相同的结果?为什么?
最佳答案
发生这种情况是因为 SQL 执行的隐式 convdrsione ..并且在每种情况下第一个字符(或字符集)都是有效数字
'1' , '1ooooì, '1ee' became 1 for implict conversion to destination type
所有查询都变成了
select * from User_Table where key ='xxxxxxxxxxxxxxxxxxxxxxxxx' and status=1
关于mysql - 在MYSQL select查询中,我们是否只需要传递 'INT'类型数据的int值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56358946/