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
2.1m questions
2.1m answers
60 comments
57.0k users