NOT NULL 列用 IS NULL 也能查到数据?
摘要
datetime列设置了NOT NULL约束,但查询条件IS NULL却能返回结果,奇怪吗?测试表DDLCREATE TABLE
t1
(id
int(11) DEFAULT NULL,dt
datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB;插入测试数据:yejr@imysql.com> insert…
欢迎在评论区写下你对这篇文章的看法。
datetime列设置了NOT NULL约束,但查询条件IS NULL却能返回结果,奇怪吗?测试表DDLCREATE TABLE
t1
(id
int(11) DEFAULT NULL,dt
datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB;插入测试数据:yejr@imysql.com> insert…
欢迎在评论区写下你对这篇文章的看法。
Home
-
Wiki
Copyright © 2011-2024 iteam.
Current version is 2.134.0.
UTC+08:00, 2024-09-29 00:20
浙ICP备14020137号-1
$Map of visitor$