U kunt sessievariabelen gebruiken:
SET @r := -1;
UPDATE mytable
SET mydate = mydate + INTERVAL (@r := @r + 1) DAY;
In SQL Server 2005
:
WITH q AS
(
SELECT *,
ROW_NUMBER() OVER (ORDER BY mydate) rn
FROM mytable
)
UPDATE q
SET mydate = DATEADD(d, rn - 1, mydate)