gpt4 book ai didi

mysql:获取不等于字段的行

转载 作者:行者123 更新时间:2023-11-29 06:18:27 25 4
gpt4 key购买 nike

如何从一个表中获取创建日期和更新日期字段不等于的行?

最佳答案

要正确执行此操作,以便对于此数据

DateCreate    DateUpdate
NULL NULL
NULL 2011-03-01 <<<
2011-03-01 NULL <<<
2011-03-01 2011-03-01
2011-03-01 2011-03-02 <<<, ***

您想要查看带有 *** 的所有行只是,那么

select * from tbl
where DateCreate <> DateUpdate

如果您想要所有带有 <<< 的行(不等于包含 null),则

select * from tbl
where DateCreate <> DateUpdate
or (DateCreate is null <> DateUpdate is null)

关于mysql:获取不等于字段的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5152478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com