【发布时间】:2020-04-14 18:22:05
【问题描述】:
如果结果返回 null,我想查看我在 where 子句中使用的值
select *
from (select PartNum, PONum from db where PartNum = '12345' and PONum = 'POX123' union
select PartNum, PONum from db where PartNum = '67890' and PONum = 'POX456' union
select PartNum, PONum from db where PartNum = '98765' and PONum = 'POX789') d
where PartNum is null
PartNum 98765 不在数据库中,这就是我需要返回以在其他地方进行比较的内容,这显然不起作用,但我无法解决如何返回空行,这似乎违反直觉。
【问题讨论】:
-
Oracle 还是 SQL Server?请只保留相关的数据库标签。
-
公平评论...Oracle 为胜利。