Pages

2016-09-14

〔SQL〕一次重新設定流水序號 / UPDATE ROW_NUMBER()

範例:執行將依據指定排序條件,將特定欄位重設流水序號


WITH UT as (SELECT SCode, L, ROW_NUMBER() OVER (ORDER BY SCODE) as RN FROM SP03 WHERE sp02_scode=100) UPDATE UT SET L=RN