默认页面
<h3>一.刷新库存表没有进货日期的记录</h3>
<p>update g_endstore set d_jinhrq2=a.iotime
from (
select m.gto as shopid,d.code,d.colorid,d.xsize,max(m.iotime) as iotime
from g_inouttbl m
join g_iodetail d on m.scripno=d.scripno
left join g_endstore e on m.gto=e.shopid and d.code=e.code and d.colorid=e.colorid and d.xsize=e.xsize
where m.ioflag=1 and m.iotime<e.d_jinhrq and e.d_jinhrq2 is null
group by m.gto,d.code,d.colorid,d.xsize
) a
where g_endstore.shopid=a.shopid and g_endstore.code=a.code and g_endstore.colorid=a.colorid and g_endstore.xsize=a.xsize
and g_endstore.d_jinhrq2 is null; </p>
<p>二 用此语句刷新d_jinhrq2 字段
update g_endstore set d_jinhrq2=a.iotime
from (
select m.gto as shopid,d.code,d.colorid,d.xsize,max(m.iotime) as iotime
from g_inouttbl m
join g_iodetail d on m.scripno=d.scripno
left join g_endstore e on m.gto=e.shopid and d.code=e.code and d.colorid=e.colorid and d.xsize=e.xsize
where m.ioflag=1 and m.iotime<e.d_jinhrq and e.d_jinhrq2 is null
group by m.gto,d.code,d.colorid,d.xsize
) a
where g_endstore.shopid=a.shopid and g_endstore.code=a.code and g_endstore.colorid=a.colorid and g_endstore.xsize=a.xsize
and g_endstore.d_jinhrq2 is null;</p>