I have a 2 tables – rout and loc.
Table Rout Columns:
Id (PK)
file_key
rout_no
....
This table has 800k records
Table Loc Columns
catalog_no(PK)
country_id
...
This table has 700k records. So I want something like this (Intersection of between two tables)
SELECT rout.file_key,rout.rout_no,loc.country_id
FROM ROUT_TBL rout, LOC_TBL loc
WHERE rout.file_key != loc.catalog_no
Can you tell me how?
I’m not sure that I understand what you’re asking. “Intersection” is a mathematical term that indicates that you want to determine which values exist in both tables. But the query you posted appears to be looking for the exact opposite– the set of rows in one table that don’t exist in the other.
If you really mean intersection
If you want all the rows in
ROUTthat don’t exist inLOCIf you want the data from
ROUTalong with the data fromLOCif it exists