I am doing this HackerRank SQL question and cannot understand why this OFFSET does not work.This is for MySQL syntax:
SELECT ROUND(LAT_N, 4)
FROM STATION
ORDER BY LAT_N
LIMIT 1 OFFSET (SELECT FLOOR(COUNT(*) / 2) FROM STATION);
But if I manually calculate the number of rows to skip, get the number, and put that number after OFFSET, it works perfectly. But it’s not dynamic. Do you know why?