Function to Calculate Median in Sql Server

Posted by Yaakov Ellis on Stack Overflow See other posts from Stack Overflow or by Yaakov Ellis
Published on 2009-08-27T18:24:33Z Indexed on 2010/04/15 7:23 UTC
Read the original article Hit count: 633

According to MSDN, Median is not available as an aggregate function in Transact-Sql. However, I would like to find out whether it is possible to create this functionality (using the Create Aggregate function, user defined function, or some other method).

What would be the best way (if possible) to do this - allow for the calculation of a median value (assuming a numeric data type) in an aggregate query?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql