经典分页SQL代码

select id,storeid,gtypeid,name,img,num,price,discount from ( select row_number() over (order by
T.id desc
) as Row , T.id,T.storeid,T.gtypeid,T.name,T.img,T.num,T.price,T.discount from tbl_sc_goods T,
dbo.tbl_sc_stores S,dbo.tbl_sc_schools C ,dbo.tbl_sc_gTypes G
where T.storeid=S.ID and S.schoolid=C.id  and T.gtypeid=G.id and C.id=1) TT where TT.Row between 1 and 11

你可能感兴趣的:(sql分页)