Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Aggiornamento SQL con row_number()

Un'altra opzione

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