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…

欢迎在评论区写下你对这篇文章的看法。

评论

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.125.1. UTC+08:00, 2024-05-17 13:15
浙ICP备14020137号-1 $访客地图$