Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rectify differences of row values in two tables

Status
Not open for further replies.

Nakis

MIS
Jun 5, 2002
37
CY
I have two tables with identical columns (164 columns actually). The first table T1 holds all original contracts into the system and column A uniquely identifies my contract number. Second table, T2, is a historical table and contains updated contracts. T2 holds all values of the contract, including updated. One contract may be changed more than once, so T2 may have more than one entry for the same contract number.
I need to find and display the differences (values that have been updated) of all contracts (and all instances of each contract) that appear in table T2, between T2 and T1.
There may be a lot of null values for each contract, so I only need to display the column values that appear to be different.


Example:
table T1 table T2
colA colB colC colA colB colC
---- ---- ---- ---- ---- ----
1 10 100 2 20 201
2 20 200 2 21 201
3 null 300 3 30 300

the differences that I need to get are:
colA T1.colC T2.colC
2 200 201

colA T1.colB T2.colB T1.colC T2.colC
2 20 21 200 201

colA T1.colB T2.colB
3 null 30


God help ;-)
thanx



 
You say you need to display changes.
In the event of 164 changes (1 change record), where and how will you display them.
What if all 164 columns get changed again, ad infinitum?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top