How did you try and delete the rows? Did you write a DELETE
statement and specify an id? Given you have 4 sets of rows that you say are unique (I'll take your word for it) and you have an ID column which repeats, you could adapt the following statement to help you.
DELETE TOP (3) FROM dbo.waqf WHERE ID IN (1,2,3,4,5,6,7,8,9,10)
EDIT
I made a mistake: Using the TOP (n)
with an IN
clause won't work as you might think - I should have tested it a bit. That will simply delete the first n rows in the table where the ID is in the specified range. Really you should loop through each of your unique IDs and issue a DELETE
per id. There's probably a better way of doing this but it's early here and my brain isn't working yet.
DECLARE @id INT
SET @id = 1
WHILE @id <= (SELECT MAX(ID) FROM dbo.waqf)
BEGIN
DELETE TOP (3) FROM dbo.waqf WHERE ID = @id
SET @id += 1
END