I have this piece of script
UPDATE t
SET t.Z_ASSOC_ROW = (t.rowid - m.MinRowID) + 1
FROM tassoc t
INNER JOIN (SELECT Booking,MIN(row id) AS 'MinRowID'
FROM tassoc
GROUP BY Booking) m
ON m.Booking = t.Booking
table 'tassoc'
rowid booking z_assoc_row
1 38 0
2 40 0
3 41 0
4 42 0
5 43 0
6 44 0
7 53 0
8 53 0
9 102 0
10 103 0
11 103 0
thanks
UPDATE t
SET t.Z_ASSOC_ROW = (t.rowid - m.MinRowID) + 1
FROM tassoc t
INNER JOIN (SELECT Booking,MIN(row id) AS 'MinRowID'
FROM tassoc
GROUP BY Booking) m
ON m.Booking = t.Booking
table 'tassoc'
rowid booking z_assoc_row
1 38 0
2 40 0
3 41 0
4 42 0
5 43 0
6 44 0
7 53 0
8 53 0
9 102 0
10 103 0
11 103 0
thanks