Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Limitting rows with ROWNUM
In article <32D31833.79F8_at_c-square.no.junk>, alvin_at_c-square.no.junk says...
>
>Some months back I asked about limiting the number of rows returned
>in a query in Oracle SQL.
>
>The answer is to use the ROWNUM pseudo-column.
>
>Eg:
>
> select columnname
> from tablename
> where rownum <= MAXROWS
>
<snip>
>Alvin Sylvain
>alvin_at_c-square.com
>++ Spams and Junk-mail are NOT appreciated. ++
Use a view and select from it:
eg.
CREATE VIEW view_example
AS SELECT *
FROM tablename
ORDER BY some_column;
SELECT columnname
FROM view_example
WHERE ROWNUM <= MAXROWS;
-- _________________________________________ | Steve Jakob | Information Systems | London Regional Cancer Centre | sjakob_at_lrcc.on.ca |_______________________________________|Received on Fri Jan 10 1997 - 00:00:00 CST