select *
from table
where id ='4fawef'
和
select *
from table
where id ='4'
这两个sql怎么都把id=4的数据查询出来了?
from table
where id ='4fawef'
和
select *
from table
where id ='4'
这两个sql怎么都把id=4的数据查询出来了?
id内容是什么
+------+------+
| a | b |
+------+------+
| 4 | 5 |
+------+------+
1 row in set, 1 warning (0.00 sec)mysql> select * from test1 where a ='4ssssssssa';
+------+------+
| a | b |
+------+------+
| 4 | 5 |
+------+------+
1 row in set, 1 warning (0.00 sec)mysql默认非严格模式 因为是id是整性 字符'4ssssssssa'自动去取前几位整数类型
Empty set, 1 warning (0.00 sec)