MySQL 更新列数据值为行号

SET @num = 0; 

UPDATE sys_menu SET sort = (@num := @num + 1);

猜你喜欢

转载自blog.csdn.net/daqiang012/article/details/80203199