Reputation: 11
WITH RowNumbers AS
(
SELECT
ROW_NUMBER() OVER (ORDER BY G TLINE) AS row_num,
gtline, gttran
FROM
GPOTRSP
)
UPDATE b
SET b.gtline = a.row_num
FROM GPOTRSP b
JOIN RowNumbers a ON b.gtline <> a.gtline
AND b.gttran = a.gttran
I want to resequence the line no after deletion on one record.
Upvotes: 1
Views: 24