mysql中以一个表的几列更新另一个表的几列
有tbl_music_disk2(a表),music_disk2(b表),要更新b表的某几个字段数据到a表中,sql语句如下:
update tbl_music_disk2 a, music_disk2 b set a.album_title_cmcc=b.album_title_cmcc,
a.artist_name_cmcc=b.artist_name_cmcc,a.track_title_cmcc = b.track_title_cmcc
where a.id=b.id
update tbl_music_disk2 a, music_disk2 b set a.album_title_cmcc=b.album_title_cmcc,
a.artist_name_cmcc=b.artist_name_cmcc,a.track_title_cmcc = b.track_title_cmcc
where a.id=b.id