在ORACLE中选取M+N到M条间的记录 select * from (select rownum r,yourTableName.* from yourTableName where rownum <= N+M) ss where ss.r >= N; 或 select * from test where id>=N minus select * from test where id>=N+M
select * from test where rownum>=20 and rownumL<=30
prettylife(风过留痕) 的方式能行吗?
to: lonwin(笑看人生): oracle8.05 for nt 没戏。
1.to_date()'; 2.M到N条记录 select * from(select rownum rn,a.* from table_name a where rownum<=N) where rn>=M;
select * from table where to_char(日期字段,'yyyy-mm-dd')>='2003-1-12' and to_char(日期字段,'yyyy-mm-dd')<='2003-2-15' select * from(select rownum rn,a.* from table_name a where rownum<=N) where rn>=M;
select * from
(select rownum r,yourTableName.* from yourTableName where rownum <= N+M) ss
where ss.r >= N;
或
select * from test where id>=N
minus
select * from test where id>=N+M
where rownum>=20
and rownumL<=30
2.M到N条记录
select * from(select rownum rn,a.* from table_name a where rownum<=N) where rn>=M;
*
from
table
where
to_char(日期字段,'yyyy-mm-dd')>='2003-1-12'
and to_char(日期字段,'yyyy-mm-dd')<='2003-2-15'
select * from(select rownum rn,a.* from table_name a where rownum<=N) where rn>=M;