给数据库某个排序字段加默认值,要求根据更新时间排序 set @sort = 0; update goods_sku set sort_value= (@sort := @sort +1) WHERE enable = ‘1’ order by update_time asc;