MySQL 一张表中两个字段值互换,两列互换

update table a, table b 
set a.filed1= b.field2, a.field2= b.field1
where a.id = b.id

原文地址:https://www.cnblogs.com/angdh/p/11801881.html