我有以下查询正常工作。
SELECT *
FROM (
SELECT *
FROM table
WHERE name IS NULL
ORDER BY date DESC
LIMIT 20
) AS T
ORDER BY date ASC;
我想要的是选择该 sql 选择查询的前 5 条记录。因此,根据我阅读的帖子,我只需要添加 TOP 5。请参见下文:
SELECT TOP 5 *
FROM (
SELECT *
FROM table
WHERE name IS NULL
ORDER BY date DESC
LIMIT 20
) AS T
ORDER BY date ASC;
不幸的是,mysql 告诉我存在语法错误,但我不明白。预先感谢您的回复。干杯。马克