All Forums Database
sinara 7 posts Joined 10/15
13 Mar 2016
How to display mismatched columns from table differences

Hi All,
I have 2 tables and both have 50 columns. If i find the differrence of these tables using minus operator, it shows 30 rows mismatched. But if i check manually each column by column, only 2 columns have mismatched records. Is it possible to display only mismatched columns in Teradata?

sgarlapa 88 posts Joined 03/13
13 Mar 2016

Hi You can try giving the column conditions at the bottom to compare if both have same value or not.
sel a.* , b.* from table a, table b
where a.col1<>b.col1 or a.col2 <> b.col2...etc
It may not be 100% solution. but by increasing /decreasing the where condition columns, can narrowdown your problem to only the columns having difference.

You must sign in to leave a comment.