We have a SQL table with few columns and one of the columns is Item. It has various values shown below.
Just use arithmetic. In SQL Server, you can use:
select t.*, ( (row_number() over (order by item) + 1) / 2 ) as batch_number from t
1.4m articles
1.4m replys
5 comments
57.0k users