sql 分页加排序等写法

select * from 

(

select ROW_NUMBER() over(order by _order desc) as _PID, * From 

(select (ID+PID) as _order ,* from Menu) as __SubQuery

)

as _SubQuery

where _PID between 12 and 20

order by _order desc 

 

你可能感兴趣的:(sql)