欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

sqlserver交换数据行中的指定列

程序员文章站 2023-11-10 23:44:34
1 2 3 UPDATE d 4 SET d.order_num = d1.order_num 5 FROM sys_dept d 6 JOIN sys_dept... ......
1 <!-- 次序上移下移 -->
2 <update id="upordown" parametertype="java.util.map">
3   update d 
4   set d.order_num = d1.order_num 
5   from sys_dept d
6   join sys_dept d1 on (d.dept_id = #{id} and d1.dept_id = #{targetid} or d.dept_id = #{targetid} and d1.dept_id = #{id})
7 </update>