11
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?

15

You want TOP:

SELECT TOP(10) Id, DisplayName FROM Users ORDER BY CreationDate DESC
  • 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

You must log in to answer this question.

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