E_T

导航

sql使用实例

Posted on 2017-05-13 14:21  E_T  阅读(108)  评论(0)    收藏  举报
  1. 将另一表中的合计值保存到指定字段,并将空值赋0   

update ShopInfo set JLRunningWater =(select COALESCE(sum(v.TotalMoney),0) as s from ViycooPayReturn v where v.ShopId=ShopInfo.ShopID and IsWithdraw=0)