Figure 3: SQL Server 2000 NTILE(4) query result
orderid qty rownum ntile4
30001 10 1 1
10001 10 2 1
10006 10 3 1
40005 10 4 2
30003 15 5 2
30004 20 6 2
20002 20 7 3
20001 20 8 3
10005 30 9 3
30007 30 10 4
40001 40 11 4