|
本帖最后由 hbghlyj 于 2022-10-26 19:06 编辑 MySql取出tid为210和280的两行, 把它们的fid和subject交换
- update `forum_thread` a
- inner join `forum_thread` b on a.tid <> b.tid
- set a.fid = b.fid,
- a.subject = b.subject
- where a.tid in (210,280) and b.tid in (210,280)
复制代码
输出信息
2 rows affected. (Query took 0.0033 seconds.)
参考资料:
Mysql: Swap data for different rows |
|