I want to split a SQL query into it's various parts:
SELECT...
FROM...
WHERE...
ORDER BY...
GROUP BY...
LIMIT...
(plus any more I missed)
Ultimately, I want to query a table, first without the WHERE statement to get a TOTAL record count. Then I will query the table without LIMIT so I get a MATCH record count. Lastly, I will run the SQL statement in its' entirity to output to the user.
Here's the catch: Knowing that the order of commands may not always be used, what is the best way to handle spliting a SQL statement into parts?
TIA
Sean Shrum