Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: [begonner] Getting a row from a table

Re: [begonner] Getting a row from a table

From: <sybrandb_at_my-deja.com>
Date: Wed, 15 Nov 2000 23:09:25 GMT
Message-ID: <8uv52v$1rd$1@nnrp1.deja.com>

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 pseudo function. The rownum is assigned after determining the resultset, but before the order by. The rownum is *not* in the table. The only useful where clause for a rownum is < n, where in your case n equals 25.
Please consult the SQL Reference Manual before asking such elementary easy to find questions. If you don't have it, it's online at http://technet.oracle.com

Regards,

--
Sybrand Bakker, Oracle DBA

All standard disclaimers apply
------------------------------------------------------------------------


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 15 2000 - 17:09:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US