Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: select first x rows from a query
Try:
SELECT * FROM
(SELECT col1
FROM mytable ORDER BY col3 DESC)
WHERE ROWID<4;
Marion
In article <3940E4F8.E71B965_at_fh-coburg.de>,
schelhor_at_fh-coburg.de wrote:
> Hi everybody!
>
> I've a table with several rows. Then I've to run a query like:
>
> SELECT col1 FROM mytable ORDER BY col3 DESC;
>
> But now I need only the first 3 rows of that resultset. Is there a way
> to do this in
> a SQL-Statement (I know: I could do that using a FOR-loop in a
> procedure, but
> this will cause some other problems ...)
>
> thanx in advance
> Tom
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 09 2000 - 00:00:00 CDT
![]() |
![]() |