Want to learn more on NTILE()

后端 未结 5 2106
耶瑟儿~
耶瑟儿~ 2020-12-08 02:19

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  
              


        
5条回答
  •  自闭症患者
    2020-12-08 02:51

    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

提交回复
热议问题