1 分页排序功能
按照物理表存储的顺序显示第10-30条记录
select top 20 * from ( select row_number() over (oder by i_id) as rowid from tableName ) a where rowid>10 and rowid<=30
2 分组汇总功能
select columnA,row_number() over (partiton by columnA order by i_id ) as rowid FROM tableName
按照columna进行分组,每一个columnA值rowid从1开始排序。
select columnA,sum(columnC) over (partiton by columnA ) as SUMC,* FROM tableName
显示表的所有值,并在第二列显示按照columnA进行的汇总值。