M-D-Luffy

MSSQL的处理方法

 
update table1
set field_1 = field_2, field_2 = field_1
可是MySQL就不能这样写,不然一列会覆盖另一列记录
 
MySQL语句如下
update table1 a, table1 b
set a.field_1 = b.field_2, a.field_2 = b.field_1
where a.id = b.id
 
 
 
转载:http://blog.163.com/lz_lls/blog/static/9793480320123273362400/

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-10-10
相关资源
相似解决方案