Hi ,
I have a query select * from login order by UserID desc limit 2; But it shows that Incorrect syntax near 'limit'.
Please help me.
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhay ShankerPosted Mar 27, 2014, 1:55 AM
So you need to modify your query as below
select TOP 2 * from login order by UserID desc
Munesh SharmaPosted Mar 27, 2014, 1:30 AM
SELECT TOP number|percent column_name(s)
FROM table_name;
mysql support "Limit" keyword
SELECT column_name(s)
FROM table_name
LIMIT number;
you use this query and run it
select TOP 2 * from login order by UserID desc