oracle 中,求满足条件(id<200)的20-30行的记录。

2024-11-24 09:52:57
推荐回答(5个)
回答1:

select * from (select row_number() over(order by id) as row_num,* from 表 where id<200) where row_num>=20 and row_num<=30 order by id

回答2:

select * from (select rownum col,t.* from table t where id < 200) t where col between 20 and 30

回答3:

select * from(
select emp.*,rownum r_ from 你的表 where empno<200)
where r_>=20 and r_<=30

回答4:

select * from (select a.*,rownum rn from table a where a.id<200) where rn>=20 and rn<=30;

回答5:

select * from(
select *,rownum t from 表名 where id<200)
where t>=20 and t<=30