重新排序

青山下發表於2024-03-26
UPDATE `crm_tag` a SET a.`sort`=(SELECT row_num FROM (SELECT id,`sort`, ROW_NUMBER() OVER (ORDER BY id DESC) AS row_num FROM `crm_tag`) AS b
WHERE a.`id`=b.id);

相關文章