Hello.


Looks like it returns as much as:

 select count(distinct id) from sale where user_id=1;



I've found it in comments at:

  http://dev.mysql.com/doc/mysql/en/Counting_rows.html





Jerry Swanson <[EMAIL PROTECTED]> 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,

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [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]

Reply via email to