a*********e 发帖数: 35 | 1 多谢各位的指点,偶在一个newsgroup得到了一个答案,已经验证过了,
可以用应该还不错,贴出来大家看看,但是里面的实现好象没有在Oral
ce里见过. 麻烦那位帮我解释一下.
/***********
The answer is:
select "what you need" from (
select rownum line, "what you need" from "your table" )
where line between "start of subset" and "end of subset"
.....
E.g.:
select name, firstname from (
select rownum line, name, firstname from names)
where line between 10 and 20
order by name;
/*********************** | B*****n 发帖数: 135 | 2 rownum is a psudocolumn in the result set, it will only be
incremented after a row has been actually selected (using
all the conditions except the one involving rownum
itself).
What i'm saying is that you cannot directly do a query
like this:
select "what you need" from "your table"
where rownum between 10 and 20;
because you never actully selected anything into the
result set, the rownum will never be greater than 0.
In other words, you want to select something based on the
rownum, while the ro
【在 a*********e 的大作中提到】 : 多谢各位的指点,偶在一个newsgroup得到了一个答案,已经验证过了, : 可以用应该还不错,贴出来大家看看,但是里面的实现好象没有在Oral : ce里见过. 麻烦那位帮我解释一下. : /*********** : The answer is: : select "what you need" from ( : select rownum line, "what you need" from "your table" ) : where line between "start of subset" and "end of subset" : ..... : E.g.:
|
|