select distinct ccode,isnull(cexch_name,''),N'',N'',N'2014.03',0,1,1,1,12 from RP_bankrecp

where not exists(

select distinct r.ccode,isnull(r.cexch_name,'')

from RP_bankrecp  r inner join gl_bankalert g on r.ccode=g.ccode and isnull(r.cexch_name,'')= isnull(g.cexch_name,'')

where iyear=2014

)

这样是错误的,not exists 只是返回是否有结果集,相当于一个true or false的值

05-08 15:42