I was reading on RANKING function for ms sql. I understand the others function except NTILE(). Lets say if i have this data:
StudentID MARKS
In Ntile function first it count the number of rows and divide it by the paramenter passed in ntile and then make a equal group of rows according to the quotient and rank them and then remaining rows will distributed by each group from the top in a shifting manner and will not take it from the least rows eg if group1 has 4 rows then it will take 5th row in its group not the last row.
Thanks