假如Table1有10条记录,n=3

select top n * from Table1
选择记录集的前n条记录,取出的记录为1,2,3

select top n * from Table1 order by id desc
如果用到order by则是先排序,然后再取前n条,取出的记录为10,9,8

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-01-07
  • 2022-01-05
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2021-10-15
  • 2021-12-02
  • 2022-12-23
  • 2021-10-04
  • 2022-03-07
相关资源
相似解决方案