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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to rescrict returned rows ???

Re: How to rescrict returned rows ???

From: Tom Best <tom.best_at_bentley.com>
Date: 2000/07/20
Message-ID: <8l7m59$20t$1@news.bentley.com>#1/1

SELECT * from (SELECT rownum r, othercols from tablename ORDER BY somecolumn) where r <= 50

HTH,
Tom Best

Bessenyei Zsolt <bessenyei_at_flexum.hu> wrote in message news:39772EAF.D962CB36_at_flexum.hu...
> Hello,
>
> I have a table with about 13 000 rows.
>
> With MS SQL I can use
> "select top 50 * from table order by field"
> command, which sends back only 50 records from a sorted table.
>
> With Oracle I can't do this, because the
> "select * from table where rownum<=50 order by field"
> first sends back 50 records, second sort this 50 records.
>
> I want to first sort, second send back only 50 records.
>
> How can I do this ?
>
> Zsolt Bessenyei
Received on Thu Jul 20 2000 - 00:00:00 CDT

Original text of this message

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