简体   繁体   中英

Comparing two fields' values in Oracle SQL

I have this statement in 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

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 . Hence, adding the condition will just compare the values in the two columns in the same row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM