请帮我重写它,以便它可以在 PostgreSQL (8.3.11) 不理解over
关键字的 Heroku 上运行。
SELECT
user_id,
round(max(hspeed) * 2.238) as chs,
percent_rank() over (partition by con_size_id ORDER BY MAX(hspeed))
FROM
summaries ss
INNER JOIN spaths s ON ss.spath_id = s.id
INNER JOIN cons c ON c.id = s.con_id
INNER JOIN users u ON c.user_id = u.id
WHERE
con_size_id = 1
GROUP BY
user_id,
con_size_id;
“user_id”和“con_size_id”来自“cons”表,“hspeed”来自“summaries”。