In SQL Server select statement, to generate and restart Group wise Serial No. following SQL Statement can be used.
in the following statement
select
ProductCategory,
row_number() over(partition by ProductCategory order by ProductCategory) AS SrNo,
ItemName
from items
group by ProductCategory
order by ProductCategory