阅读背景:

在将每个colum_1放入isnull之前,如何确定每个colum_1中的数据类型

来源:互联网 

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 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: