查询指定范围内数据记录(适用于sqlserver2005以上)
1 WITH OrderedOrders AS
2 (SELECT ROW_NUMBER()over(order by g_Id asc) as RowNumber,g_Id FROM guanxi)
3 SELECT *
4 FROM OrderedOrders
5 WHERE RowNumber BETWEEN 50 AND 60;
2 (SELECT ROW_NUMBER()over(order by g_Id asc) as RowNumber,g_Id FROM guanxi)
3 SELECT *
4 FROM OrderedOrders
5 WHERE RowNumber BETWEEN 50 AND 60;