【发布时间】:2012-11-30 12:25:58
【问题描述】:
为了显示总页码计数,我还需要在以下查询中检索结果总数。我该怎么做?
谢谢
select
AvgLevel, TotalCount, PokemonId, Type1, Speed, MonsterTotalStats
from
(select
row_number() over (order by tblPokedex.PokemonId asc) rowNumber,
AvgLevel, TotalCount, tblPokedex.PokemonId,
Type1, tblPokedex.Speed, MonsterTotalStats
from
tblPokemonStats, tblAvailablePokemons, tblPokedex
left join
tblUsersPokemons on tblPokedex.PokemonId = tblUsersPokemons.PokemonId
where
tblPokemonStats.PokemonId = tblPokedex.PokemonId
and tblPokedex.Class = 'emissary'
group by
tblPokedex.PokemonId, tblPokedex.Type1, tblPokedex.Speed,
tblPokemonStats.AvgLevel, tblPokemonStats.TotalCount, MonsterTotalStats
) result
where
result.rowNumber > 0 and result.rowNumber < 101
【问题讨论】:
-
感谢编辑 @marc_s 现在看起来好多了
标签: sql pagination sql-server-2008-r2 rowcount