Victor Sp?ng Arthursson <[EMAIL PROTECTED]> wrote: > Hi all! > > 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? >
If you want to get total number of rows in the table (without WHERE and without LIMIT) you should execute SELECT COUNT(*) FROM table_name; If you want to obtain number of rows the statement would have returned without the LIMIT clause, you can specify SQL_CALC_FOUND_ROWS keyword in the SELECT statement and then use FOUND_ROWS() function: http://www.mysql.com/doc/en/Information_functions.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]