By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

limiting number of rows returned by resultset

P: n/a
Hi;
In db2 8.2, how do I limit a query resultset to x rows?

Thanks,
nat
Mar 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
natG wrote:
In db2 8.2, how do I limit a query resultset to x rows?


.... FETCH FIRST xx ROWS ONLY

Bernd
Mar 29 '06 #2

P: n/a
Bernd Hohmann wrote:
natG wrote:
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/infoce...n/c0005280.htm
Eric
Mar 30 '06 #3

P: n/a
On Thu, 30 Mar 2006 10:11:32 +0200, Eric.Jones wrote:
Bernd Hohmann wrote:
natG wrote:
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/infoce...n/c0005280.htm
Eric


Thank you much.
nat

Mar 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.