I'm trying to solve the following exercise: https://www.hackerrank.com/challenges/weather-observation-station-20/problem
and my attempt was
from station as st
order by st.LAT_N asc
LIMIT (ceil((Select count(*)
(Select count(*) from station) -> gives the total number of rows in the table.
ceil((Select count(*) from station)/2) - > gives the middle row (if the number of rows is odd)
I subtract one, since otherwise the limit would start to offset after my middle row.
However, when I run the code, I get
> ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
>'from station as st
>order by st.LAT_N asc
>LIMIT (ceil((Select count(*)
>from stati' at line 2
Why doesn't it work?