sql更新语句

update YF_MZFYZD set jjje=tbl.jjje from (select a.xh,sum(b.jjje) jjje from YF_MZFYZD a(nolock),YF_MZFYMX b(nolock)
 where a.xh=b.fyxh group by a.xh) tbl,YF_MZFYZD x where tbl.xh=x.xh and isnull(x.jjje,0)=0

posted @ 2015-01-04 14:28  开开123  阅读(167)  评论(0编辑  收藏  举报