可用于处理背包格子中物品位置交换的语句,防止事务提交不完整导致数据出错

可用于处理背包格子中物品位置交换的语句,防止事务提交不完整导致数据出错

update test as q1 join test as q2 

on (q1.id=#id1# and q2.id = #id2#) or(q1.id = #id2# and q2.id=#id1#)

 set q1.value = q2.value,q2.value=q1.value;

猜你喜欢

转载自aben328.iteye.com/blog/1420795
今日推荐