注册

sql查询不到数据

DM_704219 2024/08/22 607 7

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:
DM Database Server 64 V8
DB Version: 0x7000c
03134284194-20240703-234060-20108
Msg Version: 12
Gsu level(5) cnt: 0
【操作系统】:
Kylin Linux Advanced Server
【CPU】:
麒麟920
【问题描述】*:
两个 sql 语句:

SELECT * FROM page WHERE ((deletedat > '2024-08-22 20:38:36' OR deletedat IS NULL)) order by id desc limit 1;
SELECT * FROM page WHERE ((deletedat > '2024-08-22 20:38:36' OR deletedat IS NULL) AND ( deletedat IS NULL)) order by id desc limit 1;

我数据库里只有一条数据, deletedat 为 null, 第一个查询能查出数据,第二个查询则不能,但是两个 sql 应该是 等价的,为什么会这样呢?

回答 0
暂无回答
扫一扫
联系客服