I have 2 tables 1. Master and 2. Transaction
Table Master structure and data
Location , Itemno, TotalQty
113, 155001, 1000
125, 155001, 1654
127, 155001, 1895
133, 155001, 324
166, 265125, 1598
Table Transaction also has similar structure
Location , Itemno, QtyTransacted
119, 155001, 150
125, 155001, 165
I have to form a query to search master table for records in transaction and come out with location and itemno combination which is not present in master.
I tried with following query but I could not get desired result.
select location, Item from Table_Transaction where location not in (select location from Table_Master) and itemno in (select itemno from Table_Master)
Please guide and help.
Table Master structure and data
Location , Itemno, TotalQty
113, 155001, 1000
125, 155001, 1654
127, 155001, 1895
133, 155001, 324
166, 265125, 1598
Table Transaction also has similar structure
Location , Itemno, QtyTransacted
119, 155001, 150
125, 155001, 165
I have to form a query to search master table for records in transaction and come out with location and itemno combination which is not present in master.
I tried with following query but I could not get desired result.
select location, Item from Table_Transaction where location not in (select location from Table_Master) and itemno in (select itemno from Table_Master)
Please guide and help.