Oracle SQL开发人员使用始终“ true”条件是从子句中删除。 (xxx“ null或xxx”不是零)
我今天使用的是Oracle SQL开发人员版本19.2.1.247,并使用图形方式删除了几行。我的意思是,我选择了行,然后按红色X十字以删除所选的行。 它奏效了,一切都很好。排除行。
但是,我看看日志并发现了这一点:
DELETE FROM "DB"."PERSONS" WHERE ROWID = 'AADG' AND ORA_ROWSCN = '5196' and ( "ID" is null or "ID" is not null )
嗯,我不明白最后一个陈述。
"ID" is null or "ID" is not null
在我看来,显然,这永远是真实的。我对知道这个Oracle SQL开发人员添加此内容的原因感到好奇。为什么使用?何时该陈述是不正确的?
I was using today Oracle SQL Developer version 19.2.1.247 and removed couple of rows using the graphical way. I mean, I selected the row and press the red x cross to remove the selected rows.
It worked, all fine. Rows were removed.
However, I took a look to the logs and find out this:
DELETE FROM "DB"."PERSONS" WHERE ROWID = 'AADG' AND ORA_ROWSCN = '5196' and ( "ID" is null or "ID" is not null )
Well, I don't understand the last statement.
"ID" is null or "ID" is not null
To my eyes, apparently, this is always going to be true. I feel curiosity about knowing the reason why this Oracle SQL Developer is adding this. Why is this used? When this statement will not be true?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能只是一个异常,但它不会对声明的执行(或性能)产生任何影响。例如,我做到了:
然后删除了SQL Dev中的一行,屈服
,优化器提出了这一点:
简单地忽略了冗余谓词。
我的表没有索引或主键,因此看起来只会从表中从表中获取第一列。
Probably just an anomaly, but it wont have any impact on the execution (or performance) of the statement. For example, I did:
and then deleted a row in SQL Dev, yielding
and the optimizer came up with this:
The redundant predicates were simply ignored.
My table had no indexes or primary keys, so it would appear the simply takes the first column from the table for this predicate.