node.js - MYSQL 中两个表的数据清洗问题
伊谢尔伦
伊谢尔伦 2017-04-17 13:04:59
0
2
828

两个表分别都有两个相同的字段比如A表有cityId,cityName.B表也有cityId,cityName.
B表的cityId和cityName都有值。A表有大量数据cityId有值且值都包含在A表。cityName为空。如何去根据B表填充A表的cityName?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
刘奇

update A join B set A.cityName=B.cityName on A.cityId=B.cityId

小葫芦
sqlUPDATE  a,  b SET a.cityName = b.cityName  WHERE a.cityId= b.cityId
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!