小编典典

SELECT TOP错误

sql

我有这个mySQL脚本:

SELECT TOP 2 * FROM produse ORDER BY `id_produs` DESC

产生此错误:

#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 '2 * FROM produse ORDER BY `id_produs` DESC LIMIT 0, 30' at line 1

问题是什么?


阅读 41

收藏
2021-04-07

共1个答案

小编典典

mysql中没有TOP

使用LIMIT 2

   SELECT * FROM produse ORDER BY id_produs DESC LIMIT 2
2021-04-07