How to display mismatched columns from table differences

Database
Enthusiast

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?

Thanks

1 REPLY
Enthusiast

Re: How to display mismatched columns from table differences

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.