Row Offset in SQL Server

后端 未结 16 2382
醉酒成梦
醉酒成梦 2020-11-22 05:53

Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it\'s possible to do:

SELECT * FR         


        
16条回答
  •  终归单人心
    2020-11-22 06:13

    Depending on your version ou cannot do it directly, but you could do something hacky like

    select top 25 *
    from ( 
      select top 75 *
      from   table 
      order by field asc
    ) a 
    order by field desc 
    

    where 'field' is the key.

提交回复
热议问题