level 1
kelly暮xiao
楼主
select pfsaleno,rzdate,orgcode,customercode,customername,ystotal,counts,sendorname
from MGRPT..HSRPT.TMGPFSALEFORM_RPT sForm
where exists
(select disp.orgcode ,disp.orgname,cust.mobile1,cust.custcode,cust.custname ,cust.mnemoniccode
from DRPDB..HSCMP.TORGDRPDISP disp
left join DRPDB..HSCMP.TDRPETPCUSTDETAIL cust on disp.orgcode = cust.orgcode
where disp.chainjymode='1'
and cust.mobile1 is not null)
and rzdate>=convert(varchar(10),GETDATE()-3,120)
order by rzdate
求大神助攻!我想将近1年的数据插入一张新表,以上我我要插入的内容,但是觉得每次都全表遍历资源消耗太大。有什么简洁的方法吗
2017年06月24日 03点06分
1
from MGRPT..HSRPT.TMGPFSALEFORM_RPT sForm
where exists
(select disp.orgcode ,disp.orgname,cust.mobile1,cust.custcode,cust.custname ,cust.mnemoniccode
from DRPDB..HSCMP.TORGDRPDISP disp
left join DRPDB..HSCMP.TDRPETPCUSTDETAIL cust on disp.orgcode = cust.orgcode
where disp.chainjymode='1'
and cust.mobile1 is not null)
and rzdate>=convert(varchar(10),GETDATE()-3,120)
order by rzdate
求大神助攻!我想将近1年的数据插入一张新表,以上我我要插入的内容,但是觉得每次都全表遍历资源消耗太大。有什么简洁的方法吗