how to get the number of rows that match a query
Posted: Fri Sep 10, 2004 5:18 am
Hello
I have a complicated query that uses LIMIT X,Y at the end
This causes the query to return up to Y element.
However I know that if the LIMIT was omitted, the query would have returned a much larger results set.
My quesion is this:
Is there a way of knowing how large the result set would have been without the LIMIT clause, without resorting to running two queries? one with the LIMIT (to get the items I need) and another without the LIMIT (to see how many items could potentially match the query)
thanks
I have a complicated query that uses LIMIT X,Y at the end
This causes the query to return up to Y element.
However I know that if the LIMIT was omitted, the query would have returned a much larger results set.
My quesion is this:
Is there a way of knowing how large the result set would have been without the LIMIT clause, without resorting to running two queries? one with the LIMIT (to get the items I need) and another without the LIMIT (to see how many items could potentially match the query)
thanks