text: SET @RECORDS = (SELECT COUNT(*) FROM STATION);
  SET @ROWNUM = 0;
  SELECT
      CASE
          WHEN MOD(@RECORDS, 2) = 1
              THEN (SELECT ROUND(LAT_N , 4)FROM (
              SELECT @ROWNUM := @ROWNUM + 1 AS rowNum, LAT_N FROM STATION ORDER BY LAT_N
          ) tmp WHERE rowNum = CEIL(@RECORDS/2))
          ELSE (SELECT ROUND(AVG(LAT_N), 4) FROM (
              SELECT @ROWNUM := @ROWNUM + 1 AS rowNum, LAT_N FROM STATION ORDER BY LAT_N
          ) tmp WHERE rowNum IN (@RECORDS/2, @RECORDS/2 + 1))
          END
  FROM
      STATION
  LIMIT 1;