Median Value

Does anybody know a way to calculate the median value in a SELECT Statement (for a graph application)? can’ t find a way to calculate it (Mysql does not have a specific function AFAIK) and in some Areas (Health for instance) is a very informative and critical metric.
even SC9 does not have this metric implemented yet.

Thanks