Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to rescrict returned rows ???
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
![]() |
![]() |