---
title: "mysql 根据B表字段 修改 A表中的值"
author: "kidd"
date: "2011-11-30T14:33:45Z"
tags: []
categories: ["数据库"]
slug: "mysql-b-a"
draft: false
lastmod: "2011-11-30T14:33:45Z"
id: 1285636
url: "https://kidd.iteye.com/blog/1285636"
---

update table1 a1 inner join (select a.id from table1 a  
                   inner join table2 b  
                   on b.id=a.id  
where b.name='nameValue')tmp on a1.id=tmp.id  
set a1.item='value'