sql server 表2字段更新到表1,mysql
UPDATE kingdee_pro_stock set
kingdee_pro_stock.org_name=ERP_BASIC_BILLNO_PREFIX.org_name,
kingdee_pro_stock.page_no=ERP_BASIC_BILLNO_PREFIX.page_no,
kingdee_pro_stock.page_name=ERP_BASIC_BILLNO_PREFIX.page_name,
kingdee_pro_stock.djlb_no = ERP_BASIC_BILLNO_PREFIX.djlb_no,
kingdee_pro_stock.djlb_name = ERP_BASIC_BILLNO_PREFIX.djlb_name,
kingdee_pro_stock.bz = ERP_BASIC_BILLNO_PREFIX.remark,
kingdee_pro_stock.djlb_code=ERP_BASIC_BILLNO_PREFIX.djlb_code
from ERP_BASIC_BILLNO_PREFIX
where kingdee_pro_stock.prefix_id=ERP_BASIC_BILLNO_PREFIX.id
============================
sql server
============================
UPDATE 表1
SET 表1 .字段= 表2.字段
FROM 表2
WHERE 表2.关链字段=表1.关链字段;
============================
mysql
============================
UPDATE 表1,表2
SET 表1 .字段= 表2.字段
WHERE 表2.关链字段=表1.关链字段;