[英]Need sql query to assign unique id by comparing two fields in multiple rows of oracle table
[英]Comparing two fields' values in Oracle SQL
我在Oracle中有以下声明:
select agnt_name,
exporter_name
from
(
select agnt_name,
exporter_name
from Exporters
union all
select agnt_name,
exporter_name
from agents
)
现在,如果我添加以下条件: WHERE agnt_name = exporter_name
我的问题是:查询会比较两个字段中的值吗?如果它们相等,它将显示记录吗? 还是该条件就像联接条件?
您没有join
您的查询-甚至没有一个隐含的join
。 因此,添加条件将只比较同一行中两列中的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.