为何top语句报错

yiyicun 2011-07-03 11:08:21
select top 10 id from table1 ;

ERROR 1064 : 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 '10 id from table1' at line 1

select id from table1 ;能查 加上top就不行了
...全文
110 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rucypli 2011-07-03
  • 打赏
  • 举报
回复
top是sqlserver的 和mysql语法,关键字不一样
yiyicun 2011-07-03
  • 打赏
  • 举报
回复
用limit可以 但我想知道top语句错在那
lxq19851204 2011-07-03
  • 打赏
  • 举报
回复
select id from table1 limit 10;

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧