XpertWorlock Posted October 3, 2010 Share Posted October 3, 2010 Hi, was wondering if it is possible to count all the rows in a table, but only query let's say the first 20 results. Currently I have to do two queries. One counting all the rows and one getting the information and limiting it to 20. Is this possible? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 5, 2010 Share Posted October 5, 2010 I think you're asking for the row count without the LIMIT clause -- not without any clauses -- and if so, SQL_CALC_FOUND_ROWS is your friend. Quote Link to comment Share on other sites More sharing options...
XpertWorlock Posted October 5, 2010 Author Share Posted October 5, 2010 That is exactly what I wanted, I figured with this many years of SQL that there had to be a way. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.