---
title: "ORACLE A表根据B表字段更新"
author: "p_3er"
date: "2014-04-16T10:15:00Z"
tags: []
slug: "oracle-a-b"
draft: false
lastmod: "2014-08-21T09:26:56Z"
id: 2106743
url: "https://p-3er.iteye.com/blog/2106743"
---

```
update product_info t set (t.salename,t.xsqy)=(select c.salename,c.xsqy from contract_erp c where c.contractcode=t.contractid)
where t.contractid in(select c.contractcode from contract_erp c) and t.contractid is not null and t.salename is null;
```