谁能告诉我如何为这个mysql语句创建一个存储过程:
SELECT city, country, population
FROM
(SELECT
city, country, population,
@country_rank := IF(@current_country = country, @country_rank + 1, 1) AS country_rank,
@current_country := country
FROM cities
ORDER BY country, population DESC
) ranked
WHERE country_rank <= 2;