Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

declare @NumberOfStudents int
declare @StudentsPerGroup int

set @StudentsPerGroup = 10
set @NumberOfStudents = 104

select number, ntile((@NumberOfStudents / @StudentsPerGroup)+1) over(order by number) as GroupID
from master..spt_values
where type = 'P' and
      number between 1 and 104

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results