Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SQL statement with LIMIT and total count?

569346May 21 2007 — edited May 21 2007
Hello,

I would like to know if it is possible to execute a single SQL statement that will return me a subset of data (for pagination purposes) that not only includes the subset of data for the page but the count of all available data. Can this be done so as to not take up the cpu and time it takes to essentially run two queries? One to get the subset and one to get the count? I think simply doing a subselect is not going to give me what I want in that we actually query twice.

There may be no way to do this other than that, but I wanted to check with the gurus here first. :)

Thanks,
Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2007
Added on May 21 2007
9 comments
7,282 views