List:General Discussion« Previous MessageNext Message »
From:Jigal van Hemert Date:March 19 2004 9:23am
Subject:Re: Count all rows if limit by?
View as plain text  
From: "Victor Spång Arthursson" <victor@stripped>
> Is there a simple way to get the total number of rows a result _should_
> have had if no where-clause where present? Without doing a second
> query?

Example from http://www.mysql.com/doc/en/Information_functions.html :

mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
       WHERE id > 100 LIMIT 10;
mysql> SELECT FOUND_ROWS();

Available since 4.0.0.; in versions prior to 4.1.0. this didn't work with
LIMIT 0.
Regards, Jigal.


Thread
Count all rows if limit by?Victor Spång Arthursson19 Mar
  • Re: Count all rows if limit by?Jigal van Hemert19 Mar
    • Re: Count all rows if limit by?Victor Spång Arthursson22 Mar
  • Re: Count all rows if limit by?Egor Egorov19 Mar