使用带有“>"的 rownum 函数登录 oracle
我想通过 rownum 函数 i_e "(rownum>3)" 选择大于 3 的行数例如,如果有 25 行,我想通过 rownum 函数检索最后 22 行.但是当我写
I want to select the number of rows which are greater than 3 by rownum function i_e "(rownum>3)" for example if there are 25 rows and I want to retrieve the last 22 rows by rownum function. but when I write the
select * from test_table where rownum>3;
它没有检索到任何行.任何人都可以帮我解决这个问题.提前致谢
it retrieve no row. can any one help me to solve this problem. thanks in advance
推荐答案
在 RDBMS 中,没有第一行或最后一行.你所谓的raws",实际上是set(sets),它们可以被订购也可以不被订购.rownum
是一个函数,它只是枚举结果集,只有在计算 set 后才有意义,要对数据集(行)进行排序,您应该在 rownum<之前的查询中进行/code> 调用,你必须告诉 DB 这个命令对于特定的 select 语句意味着什么.
In RDBMS there is no first or last rows. What you calls "raws" , actually is set(sets), they can be ordered or not. rownum
is a function, which is just enumerates result set, it makes sense only after set is calculated, to order your set of data (rows) you should do it in your query before rownum
call, you must tell DB what means for the order in particular select statement.
相关文章