select * from
(
select id,class,
sum(pay_money) as pay_money,
row_number() over(order by id) as rownum
from table_class
group by id,class
) as temp
where rownum between 1 and 3 order by id,class这样是可以实现分页可是每次得到的数据是不一样的.我想在内部排序,可是是MS-SQL不让...
求高手指教!
(
select id,class,
sum(pay_money) as pay_money,
row_number() over(order by id) as rownum
from table_class
group by id,class
) as temp
where rownum between 1 and 3 order by id,class这样是可以实现分页可是每次得到的数据是不一样的.我想在内部排序,可是是MS-SQL不让...
求高手指教!
(
select *,row_number() over(order by id) as rownum from
(
select id,class,sum(pay_money) as pay_money
from table_class
group by id,class
) a
)b
where rownum between 1 and 3 order by id,class
select * from
(
select *,row_number() over(order by id,class) as rownum from
(
select id,class,sum(pay_money) as pay_money
from table_class
group by id,class
) a
)b
where rownum between 1 and 3