SELECT Id, DisplayName FROM Users ORDER BY CreationDate DESC LIMIT 10;

That query didn't work on data.stackexchange.com. I guess LIMIT isn't a key word. As such how would I go about doing a LIMIT?

share|improve this question
3  
It's SQL Server not MySQL... Use TOP. –  ben is uǝq backwards Mar 24 '13 at 19:32
add comment

1 Answer

up vote 7 down vote accepted

You want TOP:

SELECT TOP(10) Id, DisplayName FROM Users ORDER BY CreationDate DESC
share|improve this answer
4  
It's SQL Server 2012, so you can also use the new (pretty verbose) offset 0 rows fetch next 10 rows only –  balpha Mar 24 '13 at 19:39
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .