Comparing 2 tables
Hi,
I have 2 tables and i have to compare this 2 tables and find out what are
the new thing added to the second table and what are the things missing
comparing with the first table. After this i have to create a new 3rd table
with this report.
This will be mostly text comparisons. There are 3 columns in 2 of the
tables. Column 1 is DBNAME, Column 2 is TSNAME, Column 3 is PARTITION.
Tables are ,
TABLE 1
DBNAME TSNAME PARTITION
CLIDDATP CLIXUJRH
INEDATAP INEXAGTP
INEDATAP INEXDNCL 1
INEDATAP INEXDNCL 2
INEDATAP INEXDNCL 3
INEDATAP INEXDNCL
INEDATAP INEXDNCL 4
VTGDATAP IMFNDES1
VTGDATAP IMFNDE1
VTGDMTHE IMFNDES1
VTGDMTHE IMFNDE1
TABLE 2
DBNAME TSNAME PARTITION
CLIDDATP CLIXUJRH
INEDATAP INEXDNCL 3
INEDATAP INEXDNCL 4
VTGDATAP IBNXXES1
VTGDATAP IMFNDES1
VTGDMTHE IMFNDES1
VTGDMTHE IMFNDE1
Result Table,
DBNAME TSNAME PARTITION Added/Missing
INEDATAP INEXAGTP Missing
INEDATAP INEXDNCL 1 Missing
INEDATAP INEXDNCL 2 Missing
VTGDATAP IBNXXES1 Missing
VTGDATAP IMFNDE1 Missing
VTGDATAP IBNXXES1 Added
VTGDATAP IMFNDES1 Added
The example data i have given is very less.
For this reporting, the columns in excel are,
TABLE 1 - A1
DBNAME - A2
TSNAME - B2
PARTITION - C2
D column is blank
TABLE 2 - E1
DBNAME - E2
TSNAME - F2
PARTITON - G2
H column is blank
Result TAble - I1
DBNAME - I2
TSNAME - J2
PARTITON - K2
Added/Missing - L2
I hope this will be sufficient to explain my needs.
---------------------------
Thanks You in Advance,
Bobby
|