MySQL a two field values in the table swap, swap two

 

 

 

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

Guess you like

Origin www.cnblogs.com/angdh/p/11801881.html