467,209 Members | 1,352 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,209 developers. It's quick & easy.

limiting number of rows returned by resultset

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

Thanks,
nat
Mar 29 '06 #1
  • viewed: 2947
Share:
3 Replies
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
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
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.

Similar topics

19 posts views Thread by xixi | last post: by
3 posts views Thread by Sonnich | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.