Match column data
854561Apr 12 2011 — edited Apr 14 2011I have two tables in the same database (Oracle 10g) say temp1 and Temp2 having same column names. Its as follows
Temp1
Access_ID Name Destination OrderNumber
A101 A D101 O101
A101 B D101 O102
B101 A D101 O103
B102 C D102 O104
Temp2
Access_ID Name Destination OrderNumber
A101 A D101 O101
A101 C D101 O102
B101 A D102 O103
B102 C D102 O104
Now I want to create a new table which gives the answer as such
Temp3
Access_ID Name Destination OrderNumber
A101 N Y Y
B101 Y N Y
B102 Y Y Y
Basically What it does is for each distinct(Access Id's) it compares the corresponding columns in the two tables & if there is a mismatch then it should display as N else it should display as Y.