Avatar of smsgroupltd

asked on 

Compare columns on a same table


I want to compare columns on a same table (CPS_CLAIM) and the column mappings are configured in the mapping table (CPS_CLAIM_MAPPING).

Most of the V5_ columns are populated using the rule defined in the above mapping table (E.g. V5_ID = V8_ID + 800000000) and few columns are not (E.g. V5_RESID, V5_DESC). Please see spreadsheet attached.

Now I want to write a SQL/PLSQL script to verify all the mappings are correctly executed by comparing the V5_ column values against the V8_ column values (Subracting 800000000 from V5_ column value will give you the V8_ value).

Note: I need to verify only the columns defined in the mapping table and no need to worry about other columns (E.g. V5_RESID, V5_DESC) and need to execute the script for all the tables in a schema.

Please let me know if my requirement is not clear and any help would be much appreciated.

Oracle Database

Avatar of undefined
Last Comment
Steve Wales

8/22/2022 - Mon