Try this code!!Hope you will njoy it :)
CREATE TABLE #temp1(
Numbers int
)
DECLARE @idt INT
Declare @count int
SET @idt = 0
SET @count=0
WHILE (@idt < 100)
BEGIN
SELECT @idt = @idt + 1
SELECT @count=1
WHILE(@idt>=@count)
BEGIN
SELECT @count = @count + 1
insert into #temp1(Numbers)values(@idt)
END
END
Select Numbers,ROW_NUMBER() Over(Partition by Numbers order by Numbers) As RowNum from #temp1
Select * from #temp1