Try this:
DECLARE @tmp TABLE(ID INT, [Status] VARCHAR(50))
INSERT INTO @tmp(ID, [Status])
VALUES(1, 'Pending'),(1, 'Pending'),
(1, 'Pending'),(9, 'Pending'),
(9, 'Pending'),(18, 'Pending'),
(18, 'Pending'),(18, 'Pending'),
(18, 'Pending'),(25, 'Pending'),
(25, 'Pending'),(25, 'Pending')
DECLARE @curid INT = 1
DECLARE @maxid INT = 0
SELECT @maxid = MAX(ID) FROM @tmp
WHILE (@curid<=@maxid )
BEGIN
IF EXISTS(SELECT * FROM @tmp WHERE ID = @curid)
BEGIN
SELECT * FROM @tmp WHERE ID = @curid
END
SET @curid +=1
END
Returns result sets as expected. But i need to warn you: above code executes lots of queries in short period of time. It might cause several issues. I'd suggest to get entire data at ones and then - on client side - split data to smaller portions.