遵循HQL
、
1. "from Object where field is null"
2. "from Object where field = null"
以上说法哪一项是正确的?如何在HQL
中调用null
?
最佳答案
在 ANSI SQL 中,“Null = Null”为您提供 Null,而不是 true,因此,如果您尝试选择某个值等于 null 的位置,其中答案需要为“是,它是 null”,那么您需要使用“is null”。
关于java - 以下在 where 子句中使用 null 的 HQL 查询有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14965133/