Please provide sample data is this formatDECLARE @Sample TABLE (ID SMALLINT, Amount INT)INSERT @SampleSELECT 2000, 1 UNION ALLSELECT 2000, 2 UNION ALLSELECT 2000, 3 UNION ALLSELECT 2000, NULL UNION ALLSELECT 2001, 6 UNION ALLSELECT 2001, 7 UNION ALLSELECT 2001, NULL UNION ALLSELECT 2001, 9SELECT * FROM @Sample
And then tell us how you want to modify the table.If you want to be good at T-SQL, stay away from CURSORS as long as you can.
E 12°55'05.25"N 56°04'39.16"