【发布时间】:2018-08-12 03:11:47
【问题描述】:
我有一个名为station 的表,其中有一列LAT_N。我正在尝试获得LAT_N 的中位数。
这是我的查询:
select
case when count(Lat_N)%2=0 then (select (Lat_N from station limit (1,ceil(count(Lat_N)/2))+ select (Lat_N from station limit (1,floor(count(Lat_N)/2)))))
else (Select Lat_N from station limit(1,floor(count(Lat_N)/2)+1))
end
from station;
【问题讨论】:
-
更新您的问题添加适当的数据样本和预期的结果..
-
你用的是什么版本?