sql将表中的某个字段进行排序
1. update tempTable set field1 = rownum from( select field1, ROW_NUMBER() over(order by fieldId) rownum from table1 ) tempTable 2. with tempTable as ( select field1, ROW_NUMBER() over(order by fieldId) rownum from table1 ) update tempTable set field1 = rownum
效果图