Compare and find differences in two tables in Oracle

Posted by Ruslan on Stack Overflow See other posts from Stack Overflow or by Ruslan
Published on 2010-03-29T16:26:40Z Indexed on 2010/03/29 16:53 UTC
Read the original article Hit count: 307

Filed under:
|
|
|

Hi! i have 2 tables:

  1. account: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE
  2. flex: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE

I want to show differences comparing only by: AE_CCY, DRCR_IND, AMOUNT, MODULE and ACC by first 4 characters

Example:

ID ACC       AE_CCY DRCR_IND AMOUNT MODULE
-- --------- ------ -------- ------ ------
1  734647674 USD    D        100    OP

and in flex:

ID ACC       AE_CCY DRCR_IND AMOUNT MODULE
-- --------- ------ -------- ------ ------
1  734647654 USD    D        100    OP
2  734665474 USD    D        100    OP
9  734611111 USD    D        100    OP

ID's 2 and 9 should be shown as differences.

If I use FULL JOIN I'll get no differences as substr(account.ACC,1,4) = substr(flex.ACC,1,4) are equal and others are equal and MINUS doesn't work because ID's different.

Thanks.

© Stack Overflow or respective owner

Related posts about sql

Related posts about table