Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

SQL-Update mit row_number()

Eine weitere Option

UPDATE x
SET x.CODE_DEST = x.New_CODE_DEST
FROM (
      SELECT CODE_DEST, ROW_NUMBER() OVER (ORDER BY [RS_NOM]) AS New_CODE_DEST
      FROM DESTINATAIRE_TEMP
      ) x