---
title: "Mysql连表Update"
author: "xingsan_zhang"
date: "2014-08-26T23:14:59Z"
tags: ["MySQL", "Update"]
categories: ["数据库"]
slug: "mysql-update"
draft: false
lastmod: "2014-08-26T23:14:59Z"
id: 2109350
url: "https://uuider.iteye.com/blog/2109350"
---

如下两张表

 

table A

      field id

      field name

 

table B

     field id

     filed my\_name

 

执行连表update语句

UPDATE A a, B b SET a.name = b.my\_name WHERE a.id = b.id