作业中实现特定查询语句
怎样实现已经插入的数据不要再重复插入,只插入inv1表中新增的数据插入到临时表yptc
----插入到临时表中
select T0.itemcode ,T0.Dscription ,T0.Whscode,T2.suppcatnum,T0.Quantity,T0.Priceafvat,T2.[LstEvlPric],T0.Quantity*T0.PriceafVat as 'price1' ,T2.[LstEvlPric]*T0.Quantity as 'cost' ,(T0.Quantity*T0.PriceafVat)-(T2.[LstEvlPric]*T0.Quantity) as'cost1',T0.U_003,T0.U_004,(T0.Quantity*T0.PriceafVat-T2.[LstEvlPric]*T0.Quantity)*T0.U_004 as 'total2',T0.DocEntry,T0.U_001,T0.U_002,T0.U_005,T0.U_008, T1.U_DocDate into yptc from inv1 T0 inner join oinv T1 on T0.DocEntry=T1.DocEntry inner join oitm T2 on T0.itemcode =T2.itemcode
and T0.U_004='0.08' and T0.itemcode<>'1000001' and T0.itemcode<>'40188888'
and CAST(T1.U_DocDate AS datetime) between '2010/05/19' and '2011/12/31'
把此查询写在了作业中,在某个特定的时间执行,如何实现。