Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

limiting number of rows returned by resultset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
natG - 29 Mar 2006 23:49 GMT
Hi;
In db2 8.2, how do I limit a query resultset to x rows?

Thanks,
nat
Bernd Hohmann - 30 Mar 2006 00:01 GMT
> In db2 8.2, how do I limit a query resultset to x rows?

... FETCH FIRST xx ROWS ONLY

Bernd
Eric.Jones - 30 Mar 2006 09:11 GMT
>> In db2 8.2, how do I limit a query resultset to x rows?
>
> ... FETCH FIRST xx ROWS ONLY
>
> Bernd

If you intend to use this often, against large tables, consider also using:

 ... OPTIMIZE FOR xx ROWS

There's a good overview in the section: Guidelines for restricting select statements  at:

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.
udb.doc/admin/c0005280.htm


Eric
natG - 30 Mar 2006 18:40 GMT
>>> In db2 8.2, how do I limit a query resultset to x rows?
>>
[quoted text clipped - 11 lines]
>
> Eric

Thank you much.
nat
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.