可用于处理背包格子中物品位置交换的语句,防止事务提交不完整导致数据出错
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;
可用于处理背包格子中物品位置交换的语句,防止事务提交不完整导致数据出错
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;