A M Thomas wrote:
> It makes a lot of sense from a user interface point of view to show the > web user the _total_ number of records that match the search criteria, > and possibly, calculated from that, the number of batches (think > Google). I don't know of any way in SQL other than a second COUNT (*) query. You may be better off doing the LIMIT part in perl rather than SQL -- do the full query, get the rows() to find the total matching the query. If you can spare the memory, use selectall_arrayref and perform your limit with a splice. Otherwise, loop through a fetch with a counter and stop after the desired limit. Either of those would avoid a second query. -- Jeff
