日期:2014-05-16 浏览次数:20955 次
select h.cbilltypecode, h.vnote, h.pk_corp, h.ts, '上游单据关闭' yuanyin
from nc_ic_general_h h
where h.cgeneralhid in (select datahid
from nc_synclog l
where l.synclog like '%关闭%'
and l.ts >= '2014-03-26 00:00:00'
and l.ts <= '2014-04-15 00:00:00'
and l.unitcode = '1002'
and l.syncflag = '2')
union all
select h.cbilltypecode, h.vnote, h.pk_corp, h.ts, '上游单据不存在' yuanyin
from nc_ic_general_h h
where h.cgeneralhid in (select datahid
from nc_synclog l
where l.synclog like '%不存在%'
and l.ts >= '2014-03-26 00:00:00'
and l.ts <= '2014-04-15 00:00:00'
and l.unitcode = '1002'
and l.syncflag = '2')