Reputation: 315
I need to apply a Rank function in MYSQL 5.6.10. The issue is, I am getting a syntax error when i am using the standard syntax i found online
Eg:
INSERT INTO t(val)
VALUES(1),(2),(2),(3),(4),(4),(5);
SELECT
val,
RANK() OVER (
ORDER BY val
) my_rank
FROM
t;
I am getting a red line suggesting a syntax error near 'OVER ('
Upvotes: 1
Views: 249
Reputation: 1105
As far as i know window functions are introduced after version 8 and above. source
Something like this may give you some insights.
SELECT
val,
(select 1+count(*) from t b where t.val>b.val)"rank"
FROM
t;
Upvotes: 1