Need Oracle SQL Logic For Comparing Data Between Two Tables :: Like VLOOKUP in Excel


Acct Cust Owner Name

1111 A111 PRIM Dan Jason

1111 B111 SECO Donna Jason

1111 C111 SECO July Jason


Acct Cust Owner Name

2222 B111 PRIM Donna Jason

2222 C111 SECO July Jason

2222 DD22 SECO Jimmy James

I have to compare the table1.Cust field against the table2.Cust field. If all the t1.cust and t2.cust are same, then the record can be ignored. If any of the t1.cust(s) is different from t2.cust(s), the record should be reported.

In the above example, since one customer in Table 1 and Table 2 are different (Dan Jason and Jimmy James) and all others are similar, I need to report both account numbers 1111 and 2222 stating that the customers are different.

This is like vlookup in excel. However, I am not sure if this is possible in Oracle. Can someone guide me?

Read more here:

Content Attribution

This content was originally published by Ram at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: