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

Home -> Community -> Usenet -> c.d.o.misc -> Re: a select data from a table

Re: a select data from a table

From: Jan Nowitzky <nowitzky_at_informatik.uni-jena.de>
Date: Tue, 19 Oct 1999 18:19:21 +0200
Message-ID: <380C9A09.3E796774@informatik.uni-jena.de>


Hi,

I don'nt know what you want to do. Rownum is not a good predicate, because this number is assigned during querying. Every first tupel on each query has rownum=1.
But if you want to have the 10th, 11th and 12th tupel you must write:

select * from worker
where rownum < 13
minus
select * from worker
where rownum < 10
/

Jan

Jingyan wrote:
>
> Hi,
> 1.my a SQL statement is below.
> select * from worker
> where rownum between 10 and 12
> /
> When I run it, no rows select. in fact, worker table has 14 rows.
> If I run it like this:
> select * from worker
> where rownum between 1 and 12
> it selects 12 rows. I want to know why?
>
> 2. how to write a select statement to list the five oldest workers from the
> worker table.
> select * from (select * from worker order by age desc)
> where rownum < 6;
> above is my way, but it doesn't work on my compuer. please help me.
> Thanks in advance,
> Jingyan

--



Jan Nowitzky
Friedrich-Schiller-Universität o Institut für Informatik E-Mail nowitzky_at_informatik.uni-jena.de
Received on Tue Oct 19 1999 - 11:19:21 CDT

Original text of this message

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