Weather Observation Station 14

Query the greatest value of the Northern Latitudes (LAT_N) from STATION that is less than 137.2345. Truncate your answer to 4 decimal places.

Input Format

The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.

Analysis

we will need to first get a list order descendingly by latitude, and less than 137.2345, and then select the highest value in the list

  • select LAT_N

  • ROUND(LAT_N, 4)

  • FROM STATION

  • WHERE LAT_N < 137.2345

  • ORDER BY LAT_N DESC

  • LIMIT 1

/*QUERY 1*/
SELECT ROUND(LAT_N, 4) FROM STATION WHERE LAT_N < 137.2345 ORDER BY LAT_N DESC LIMIT 1

/*QUERY 2*/
SELECT ROUND(MAX(LAT_N), 4) FROM STATION WHERE LAT_N < 137.2345;

Last updated