You are viewing a single comment's thread. Return to all comments →
1st: Manual Method
SELECT CAST(AVG(LAT_N) AS DECIMAL(10,4)) FROM ( SELECT LAT_N, ROW_NUMBER() OVER (ORDER BY LAT_N) AS RN, COUNT(*) OVER () AS N FROM STATION ) AS X WHERE RN IN (FLOOR((N + 1) / 2.0), CEILING((N + 1) / 2.0));
2nd: With PERCENTILE_CONT(0.5) Method:
SELECT DISTINCT CAST(PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY LAT_N) OVER () AS DECIMAL(10,4)) FROM STATION;
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 20
You are viewing a single comment's thread. Return to all comments →
Two Different & Easy Methods For SQL Server
1st: Manual Method
2nd: With PERCENTILE_CONT(0.5) Method: