[英]Comparing two fields' values in Oracle SQL
I have this statement in Oracle: 我在Oracle中有以下声明:
select agnt_name,
exporter_name
from
(
select agnt_name,
exporter_name
from Exporters
union all
select agnt_name,
exporter_name
from agents
)
now if I add this condition: WHERE agnt_name = exporter_name
现在,如果我添加以下条件:
WHERE agnt_name = exporter_name
My question is: Will the query compare the values in both fields & if they equal it'll show the records? 我的问题是:查询会比较两个字段中的值吗?如果它们相等,它将显示记录吗? Or will this condition be like a join condition?
还是该条件就像联接条件?
You have no join
in your query -- not even an implicit join
. 您没有
join
您的查询-甚至没有一个隐含的join
。 Hence, adding the condition will just compare the values in the two columns in the same row. 因此,添加条件将只比较同一行中两列中的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.