Your sample query doesn't really make sense, but perhaps you are looking for
SQL_CALC_FOUND_ROWS. From the manual, "SQL_CALC_FOUND_ROWS (available in
MySQL 4.0.0 and up) tells MySQL to calculate how many rows there would be in
the result set, disregarding any LIMIT clause. The number of rows can then
be retrieved with SELECT FOUND_ROWS()"
<http://dev.mysql.com/doc/mysql/en/SELECT.html>.
If that's not it, perhaps you could give some details of whhat you want.
Michael
Jerry Swanson wrote:
This is my query
select id, status from sale where user_id = 1 GROUP BY id;
I need to know how many rows or how many entries this query returns. I
tried to use "count" and "sum". But the result is wrong.
I want to be able to make select and know how many rows this query
returns. Now, I use mysql_num_rows in php,
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]