gpt4 book ai didi

ruby - 在 Postgres 中运行 bool 表达式

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

我试图证明 ruby​​ 和 postgres 如何处理 null 相等性之间的区别。

例如,在 ruby​​ 中,我运行 nil == nil 并得到 true。我想尝试在 postgres 中运行相同类型的查询并显示 null = null 为 false,但不确定如何构造它。

或者证明 null = null 为真且 null != null 也为真。

最佳答案

select null = null;
?column?
----------

(1 row)

它不是假的,也不是真的,而是未定义的。

关于ruby - 在 Postgres 中运行 bool 表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55534351/

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