I\'m trying to write a SQL SELECT query that has a batch number column that increments every 5 rows, I\'ve tried using a hacky integer division on a dynamic row number, but can\
select ROW_NUMBER() OVER (Order by (select 0)) AS RowNumber,
(case when convert(int, (ROW_NUMBER() OVER (Order by (select 0)) % 5))=0 then 0 else 1 end) + convert(int, (ROW_NUMBER() OVER (Order by (select 0)) / 5)) as BatchNumber,
* from WorkQueue