我有带有 id 和排序的表我需要创建这个更新
mysql_query("
UPDATE `steps` SET sort = '2' WHERE id = '9' ;
UPDATE `steps` SET sort = '1' WHERE id = '5' ;
UPDATE `steps` SET sort = '3' WHERE id = '6' ;
UPDATE `steps` SET sort = '4' WHERE id = '4' ;
UPDATE `steps` SET sort = '5' WHERE id = '2' ;
UPDATE `steps` SET sort = '6' WHERE id = '1' ;
UPDATE `steps` SET sort = '7' WHERE id = '8' ;
");
这样的事情是不正确的
mysql_query("UPDATE `steps` SET sort = '2' WHERE id = '9' , sort = '1' WHERE id = '5' , sort = '3' WHERE id = '6' ;");
如何缩小它?你有什么想法吗?