Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Median Function?

Status
Not open for further replies.

David75

Programmer
Nov 15, 2001
21
0
0
CA
Does anyone have a quick way to determine the median of a set in a SELECT statement (or otherwise)? Ideally I wish there was a MEDIAN T-SQL function that worked like like AVG.
 
There is no MEDIAN function in SQL or T-SQL. There are some excellent discussions of varous methods in several newsgroups. However, I've tried some of the SQL code and found performance to be poor.

Search Google Groups for these key words -

median average "sql server"


My favorite thread was at this link.

Terry L. Broadbent - Salt Lake City, UT
Home of the 2002 Winter Olympics (Feb 8-24)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top