Calculating the Normal Average or Median() value in T-SQL 2008R2

  • Anyone have any ideas on how to perform in T-SQL what is called the Median() in Excel?

    Kindest Regards,

    Just say No to Facebook!
  • Check out http://sqlperformance.com/2012/08/t-sql-queries/median.

    Just be aware that the dueling row numbers approach (2005_A in the article) does not guarantee the correct result if there are ties in the values used for ordering, so if limited to pre-2012 approaches, I'd use the 2005_C.

    Cheers!

  • Jacob Wilkins (2/3/2016)


    Check out http://sqlperformance.com/2012/08/t-sql-queries/median.

    Just be aware that the dueling row numbers approach (2005_A in the article) does not guarantee the correct result if there are ties in the values used for ordering, so if limited to pre-2012 approaches, I'd use the 2005_C.

    Cheers!

    Will do. Thanks

    Kindest Regards,

    Just say No to Facebook!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply