sql语句的精典

select rowid,name,age,state from
(select *,RANK() over (partition by name order by [state]) as row from test1)
a where row=1

分组查询

 

select rowid,name,age,state from
(select *,row_num() over (order by [id]) as row from test1)
a where row<10 and row>100

分页查询

你可能感兴趣的:(sql语句的精典)