zhubangchao

写出一条Sql语句:取出表Customer中第31到第40记录(SQLServer,以自动增长的Id作为主键,注意:Id可能不是连续的。

select top 10 * from (select ROW_NUMBER() over(order by Id) as rows,* from Customer) as C where C.rows>30 order by Id

select top 10 * from Customer where id not in(select top 30 Id from Customer order by Id)order by Id

select top 10 * from Customer where id>(select MAX(Id) from (select top 30 Id from CUstomer order by Id) as Customer) order by Id

发表于 2018-03-06 13:22 学着用 阅读(...) 评论(...) 编辑 收藏
 

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2021-06-06
  • 2022-12-23
  • 2021-11-02
  • 2021-11-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-01-02
  • 2022-12-23
相关资源
相似解决方案