[Techtalk] How do I limit my oracle resultset to 100 rows
Tricia Bowen
tricia.bowen at gmail.com
Fri Nov 9 19:59:47 UTC 2007
Thanks for the help.
The rownum <=100 did the trick. I couln't get the 'limit' function to work.
It gave me a "SQL Command not properly ended" error. I didn't check to see
if it was available in Oracle 9i. Here is how I tried using it:
SELECT * FROM contact c
where c.name like 'A%'
order by c.LAST_NAME
limit 10
--Tricia
On Nov 9, 2007 1:06 PM, Kathryn Hogg <kjh at flyballdogs.com> wrote:
>
> Tricia Bowen wrote:
> > Help!
> > I have a query that returns over 10,000 rows. It's a pretty sizable
> query
> > so
> > it takes a while to run. How do I limit the number of rows returned to
> > 100?
>
> if its oracle 8i or newer, use the SQL standard by adding "row_number <=
> 100" to your where clause.
>
> if its an older version of oracle, replace row_number with rownum
>
> --
> Kathryn
> http://womensfooty.com
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>
--
--Tricia
More information about the Techtalk
mailing list