0

I am trying to get the upper quartile, median and lower quartile in SQL Server. Is there any function or formula? Please advice - many thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Rookie
  • 11
  • 1

2 Answers2

0

It sounds like you need the ntile function with either 4 (which ranks all the values based on column into 4 buckets ) or 3 which ranks all values in based on a column into three buckets.

benjamin moskovits
  • 5,261
  • 1
  • 12
  • 22
0

you can use NTILE function with the Over clause ordering the data by any appropriate column in your table/

puzeledbysql
  • 184
  • 2
  • 12