mysql Updates a field in one table equal to a value instance of a field in another table

  • 2021-07-18 09:12:03
  • OfStack

As shown below:


update table1 as z left join table2 as zb on z.zcatId = zb.zcatId set z.zcatName = zb.zcatName where z.zcatName is null; 

Related articles: