- 论坛徽章:
- 0
|
本帖最后由 cenalulu 于 2013-02-05 13:54 编辑
大家好,我用错误的类型和不存在的值,查询出来了结果(如下所示),这个是如何造成的?请给为大侠指点一下啊。
mysql> select * from user where userid=0 and userpwd=0;
+----------+----------+
| userid | userpwd |
+----------+----------+
| 00000000 | rootroot |
+----------+----------+
1 row in set, 1 warning (0.04 sec)
mysql> select * from user where userid=0;
+----------+----------+
| userid | userpwd |
+----------+----------+
| 0 | 1 |
| 00000000 | rootroot |
+----------+----------+
2 rows in set (0.00 sec)
mysql> select * from user where userpwd=0;
+----------+----------+
| userid | userpwd |
+----------+----------+
| 00000000 | rootroot |
+----------+----------+
1 row in set, 1 warning (0.00 sec)
mysql> select * from user where userid=0 and userpwd=0;
+----------+----------+
| userid | userpwd |
+----------+----------+
| 00000000 | rootroot |
+----------+----------+
1 row in set, 1 warning (0.00 sec)
|
|