how to show differences between sets of data in Oracle
I am learning Oracle Pl/Sql and have a scenario as follows which I can't seems to figure out: I have a legacy table of application settings i.e. see table columns below.
I want to get a list of the settings that exist for Branch 991/Address 123456 that do not exist for 992/Address 987654 i.e rows with ID 5 and 6.
I have a UNION statement that gets me combined but I can't figure out how to get only the differences.
where ADDRESS='123456' AND BRANCH = '991'
where ADDRESS='987654' AND BRANCH = '992' )
I tried adding a WHERE NOT EXISTS to above
WHERE NOT EXISTS
where address='987654' AND BRANCH = '992');
but it returns no records...
This is the data:
ID SYSTEM KEY1 KEY2 KEY3 KEY4 BRANCH ADDRESS
1 ABC URI CODE NULL NULL 991 123456
2 ABC URI CODE NULL NULL 992 987654
3 ABC URI CODE NULL NULL 992 666666
4 ABC READ REV 1 4 991 123456
5 ABC READ REV 1 4 992 987654
6 ABC DEV OPEN 0 0 991 123456
7 ABC ICI ORD 0 0 991 123456
Appreciate any help...