SQL Server SELECT LAST N Rows

前端 未结 18 2204
猫巷女王i
猫巷女王i 2020-11-28 03:13

This is a known question but the best solution I\'ve found is something like:

SELECT TOP N *
FROM MyTable
ORDER BY Id DESC

I\'ve a table wi

18条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 04:06

    use desc with orderby at the end of the query to get the last values.

提交回复
热议问题