[SQL]幫某個欄位填入補0並且加字頭的順號語法 - topcat 姍舞之間的極度凝聚- 點部落
UPDATE [要更新的資料表] SET [要更新的欄位]= V2.RID FROM ( SELECT 'TOPCAT' + RIGHT('0000000000' + CAST(ROWID AS varchar),10) AS RID, * FROM ( SELECT ROW_NUMBER() OVER(ORDER BY [順號依據的排序欄位]) AS ROWID ,* FROM [要更新的資料 ......