Compare Two Tables And Find Only. We ideally want only 1 row of data for Bob and Sweaters and 1 row of data for Jane and T-Shirt. It makes no sense to manually compare the value of each cell.
Sometimes we need to identify the unmatched data from two tables especially in the case when data is migrated. The WHERE clause then removes those rows where a match was found leaving as a result only those rows where a row only existed in a or b. This command line tool is used to compare tables.
We can compare data from two tables of DB2 tables using the below simple query Step 1- Select which all columns we need to compare from table T1 of schemaS SELECT T1col1T1col3T1col5 from ST1 Step 2- Use Minus keyword for comparing 2 tables.
That is why over the years I wrote many posts on this topic. You include the fields that you want to display and you also include the field that corresponds to the field that you want to use as a criterion. It returns all rows in table 1 that do not exist or changed in the other table. Lets assume that you have two tables table A and table B with a primary key called primary_key and two other columns column1 and column2.