gpt4 book ai didi

mysql - 使用顶级查询时出现sql语法错误

转载 作者:行者123 更新时间:2023-12-01 00:00:33 25 4
gpt4 key购买 nike

我正在为我的表使用顶级查询但遇到错误

You have an error in your sql syntax, chekck the manual that corresponds to your mysql server version for the right sytntax to use near '4 * from sitemain order by siteid desc limit 0,30' at line 1

这是我使用的代码

SELECT top 4 *
FROM sitemain
ORDER BY siteid DESC

最佳答案

您将 MySQL 和 TSQL 语法混合在一起。查询显然是 MySQL(来自错误消息)。你想要的是

SELECT * FROM sitemain ORDER BY siteid DESC LIMIT 0,4

关于mysql - 使用顶级查询时出现sql语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22895942/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com