select * from (select RANK() OVER (ORDER BY a.kpi_id) SID, a.* from tsqm_kpi a where seq =0 and state = '0' ) obj where sid <=10 and sid > 5