mysql 根据一张表更新另一张表

update tablea a, tableb b set a.bname=b.name where a.bid=b.id and a.id between 262 and 271

between 是>= and <=,即包含两个边界

 

update tablea a inner join tableb b on a.bid=b.id set a.bname=b.name where a.id between 262 and 271

 

posted @ 2018-07-12 13:31  raindream  阅读(5833)  评论(0编辑  收藏  举报