MySQL error: What is wrong with my syntax for ranking?
MySQL error: What is wrong with my syntax for ranking?
我的 MySQL 版本是 5.6。
我有一个 MySQL 查询出错,需要帮助才能理解我做错了什么。
这里是查询:
select images.thumbnail16x9_file,
images.square_file,
RANK() OVER (ORDER BY images.timestamp desc) rank
from images
where images.media_id = 875021;
这是错误信息:
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 '(ORDER BY images.timestamp ) rank
from images where images.media' at line 3
如果我这样做,我会得到结果:
select images.thumbnail16x9_file,
images.square_file
from images
where images.media_id = 875021 ;
有什么见解吗?
我的 MySQL 版本是 5.6。
我有一个 MySQL 查询出错,需要帮助才能理解我做错了什么。
这里是查询:
select images.thumbnail16x9_file,
images.square_file,
RANK() OVER (ORDER BY images.timestamp desc) rank
from images
where images.media_id = 875021;
这是错误信息:
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 '(ORDER BY images.timestamp ) rank
from images where images.media' at line 3
如果我这样做,我会得到结果:
select images.thumbnail16x9_file,
images.square_file
from images
where images.media_id = 875021 ;
有什么见解吗?