|
-
Apr 13th, 2008, 11:24 AM
#1
Get both COUNT and LIMITed resultset
All,
I have a moderately expensive looking WHERE clause that I need to execute against a table. I would like to get both the total COUNT of all rows matching this clause, and a resultset bounded by a LIMIT clause.
At present I execute the query twice, once with COUNT and without the LIMIT clause, and once with the desired columns and with the LIMIT clause. This strikes me as inefficient and I would like to improve on it but don't know how to.
Is there any way of fetching both in one round trip?
Thanks,
— P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|