【笔记】mysql两条数据的某个属性值互换

update groupuser as g1 join groupuser as g2 on (g1.user_id=1 and g2.user_id = 2)
or(g1.user_id = 2 and g2.user_id=1)
set g1.group_id = g2.group_id,g2.group_id=g1.group_id;

  

posted @ 2016-10-20 14:14  我的bug  阅读(2082)  评论(0编辑  收藏  举报