I was trying to solve a HackerRank SQL problem using Rank() and Row_number(), but kept getting errors. I then tried making a simple window function on a simple table
SELECT RANK() OVER (PARTITION BY countrycode ORDER BY population DESC) AS rank FROM city;
from https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true ,and sure enough: "ERROR 1064 (42000) at line 1: 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 'rank FROM city' at line 1".
Similar code works for me when coding MySQL through my command line, and the manual doesn't show any errors. Does anyone know why?