MYSQL交换两列数据实例

时间:2022-06-07 12:50:41

UPDATE cf_2015_company a, cf_2015_company b
SET a.cname = b.linkman, a.linkman = b.cname
WHERE a.id = b.id AND CHAR_LENGTH(a.cname)<5 AND CHAR_LENGTH(a.linkman)>5