Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: to sqlplus expert. - is this sqlplus version problem?
Comments embedded.
jdyang wrote:
> Hello. I'm newbie of sqlplus.
>
> I use sql plus 8.1.5.0.0.
>
Not the best version to use if you have a choice.
> I want to get row between 3 to 5. like,
>
For what purpose?
> select * from table where rownum >= 3 and rownum =< 5;
>
> and when I use above query, there is no record.
>
> I found reason from google that rownum is attached to row when that row
> pass the where condition.
Correct, and you have to assign a 1 before you can get to 3, and you haven't done so.
> And from another webpage, I found the message that those query are
> working well.
>
You apparently misread the webpage, as that query will NEVER return results. Ever.
> how I can get row between 3 to 5. Above query is just version problem?
>
> Infact, I'm using temporary query:
> select * from
> ( select <column names>, rownum as temp_rownum where <table> )
> where temp_rownum >= 3 and temp_rownum <=5;
>
That won't work, either. This should:
select t.*
from (select rownum r, table.* from table) t
where t.r between 3 and 5;
I am still lost as to the reason you need this.
>
> and surely, I'm not satisfied.
>
> Can you help me please? - to sql experts.
David Fitzjarrell Received on Fri Oct 14 2005 - 10:02:27 CDT
![]() |
![]() |