Limit rowcount
Posted in 2000
Topics: General Discussion
Hi folks, Appreciate if anyone could let me know how to limit the number of rows in Informix. In Oracle select * from table where rownum < 10 would give 9 rows. Thanks Ron
Ron Singh wrote: > > Hi folks, > Appreciate if anyone could let me know how to limit the number of rows > in Informix. In Oracle select * from table where rownum < 10 would give > 9 rows. > Thanks > Ron The sqlcmd utility has an option for this (-L 10 would give the first 10 rows). "sqlcmd" is available at ftp://www.iiug.org/pub/ and has many other nifty features ... Or you could use 'rowid'.
Hi,
I'm not sure what version of Informix it started with, but with 7.3 and
higher, the same thing should is done with an Informix SQL statement:
select first 9 * from table;
Gives you 9 rows. There's limitations to how the "first" can be used, you
should consult the Informix Guide to SQL manual. Of course, you can find
the manuals at http://www.informix.com/answers.
There's other stuff that you could do as well, if you a Red Brick or XPS
(8.x) version engine (XPS: select * from 9 samples of table; Red Brick has
a ranking you can use). The XPS syntax is also in the Informix Guide to
SQL, the Red Brick syntax is in another manual somewhere...
Have fun,
Reece
"Ron Singh" <ron@ezenet.com> wrote in message
news:39D24C13.EAB7314C@ezenet.com...
> Hi folks,
> Appreciate if anyone could let me know how to limit the number of rows
> in Informix. In Oracle select * from table where rownum < 10 would give
> 9 rows.
> Thanks
> Ron
>
>