当前位置:Gxlcms >
数据库问题 >
How to calculate Median using MySQL
How to calculate Median using MySQL
时间:2021-07-01 10:21:17
帮助过:20人阅读
@ROW_NUMBER:
=0;
select round(
avg(LAT_N),
4)
from
(
select
@Row_Number :
= @Row_Number +1 as count_of_group,
LAT_N ,
(SELECT
COUNT(
*)
FROM
Station
) AS total_of_group
from station
order by Lat_N
asc
)
tmp
where count_of_group
between total_of_group
/ 2.0 AND total_of_group
/ 2.0 + 1
How to calculate Median using MySQL
标签:class round ber sql mysq weight color median station