I have the following query:
我有以下查询:
select t1.cod_id,
case when isnull(t1.colum_1,'')=isnull(t2.colum_1,'') then 'ok' else 'error' end colum_1,
case when isnull(t1.colum_2,'')=isnull(t2.colum_2,'') then 'ok' else 'error' end colum_2,
case when isnull(t1.colum_3,'')=isnull(t2.colum_3,'') then 'ok' else 'error' end colum_3,
...
...
...
case when isnull(t1.colum_n,'')=isnull(t2.colum_n,'') then 'ok' else 'error' end colum_n,
from BD_1.MyTable t1 (nolock)
inner join BD_2.MyTable t2 (nolock)
on(t1.cod_id=t2.cod_id)
where t1.year='2009' and t1.mounth='05'
select