insert d (ANAME,BSUM,CSUM,DATE)
select a.name,
(select count(*) from B where medate>=dateadd(day,-1,getdate()) and medate<=getdate() and mename=A.NAME) as BSum,
(select count(*) from C where medate>=dateadd(day,-1,getdate()) and medate<=getdate() and mename=A.NAME) as cSum,
dateadd(day,-1,getdate()) as Date
from a
调度每天0:00执行,每天一次
select a.name,
(select count(*) from B where medate>=dateadd(day,-1,getdate()) and medate<=getdate() and mename=A.NAME) as BSum,
(select count(*) from C where medate>=dateadd(day,-1,getdate()) and medate<=getdate() and mename=A.NAME) as cSum,
dateadd(day,-1,getdate()) as Date
from a
调度每天0:00执行,每天一次
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货