what is the sql code for calculating the Median?
http://sqlperformance.com/2012/08/t-sql-queries/median