SELECT TOP error

前端 未结 2 1621
别跟我提以往
别跟我提以往 2020-12-11 17:04

I have this mySQL script:

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

Generates this error:

#1064 - You have an e         


        
相关标签:
2条回答
  • 2020-12-11 17:11

    there is no TOP in mysql

    use LIMIT 2

       SELECT * FROM produse ORDER BY id_produs DESC LIMIT 2
    
    0 讨论(0)
  • 2020-12-11 17:19

    Use LIMIT instead:

    SELECT * 
    FROM   produse
    ORDER  BY id_produs DESC
    LIMIT  2
    
    0 讨论(0)
提交回复
热议问题