Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I want get top 1st row from orders table. The following query works in sql server:
select top 1(OrderID) from dbo.Orders order by OrderID desc
But it does not work in MySql - how should it be written for MySql?
For MySQL use LIMIT
select OrderID from dbo.Orders order by OrderID desc LIMIT 1;
select top (1) OrderID from dbo.Orders order by OrderID desc
Add a comment
SELECT OrderID FROM dbo.Orders ORDER BY OrderID desc LIMIT 1;
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.