![](/img/trans.png)
[英]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.