Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: [begonner] Getting a row from a table
In article <8uu5su$vjl$1_at_marte.lastminutetour.com>,
"Francesco Marchioni" <Francesco.Marchioni_at_lastminutetour.com> wrote:
> Hello,
> I have a table with 27 records.
>
> SQL> select count(*) from mytable;
>
> COUNT(*)
> ----------
> 27
>
> #so why I don't get anything when I :
>
> select * from mytable where rownum = 25;
> No rows selected
>
> #I also don't get anything when I try
>
> select * from mytable where rownum > 25;
> No rows selected
>
> Thanks in advance.
> --
> Francesco Marchioni
> Java Developer
>
> "In a world without fences, why does one need Gates ?"
> Anonymous
>
>
rownum is a tricky pseudocolumn. It counts records in the output. So query select * from mytable where rownum < 25 will return 24 rows, but your query will return none. You can use inline view to get 25th record:
select * from
(select m.*, rownum r from mytable m)
where r > 25
By the way, resulting records are random by definition!
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 15 2000 - 16:41:14 CST
![]() |
![]() |