Michael Stassen wrote:
>
> Not exactly. They aren't the same. COUNT(id) counts distinct values of
> id, while COUNT(*) simply counts rows. [snip]
Actually, COUNT(id) counts non-NULL values of id. COUNT(DISTINCT id)
would count distinct values.
http://dev.mysql.com/doc/mysql/en/group-by-functions.html#id2873509
Jasper
| Thread |
|---|
| • query - select from one, update another | Sebastian | 8 Aug |
| • Re: query - select from one, update another | Gleb Paharenko | 8 Aug |
| • Re: query - select from one, update another | Enrique Sanchez Vela | 8 Aug |
| • Re: query - select from one, update another | Gleb Paharenko | 8 Aug |
| • Re: query - select from one, update another | Sebastian | 8 Aug |
| • Re: query - select from one, update another | SGreen | 8 Aug |
| • Re: query - select from one, update another | Nuno Pereira | 8 Aug |
| • Re: query - select from one, update another | Sebastian | 8 Aug |
| • Re: query - select from one, update another | SGreen | 8 Aug |
| • Re: query - select from one, update another | Nuno Pereira | 8 Aug |
| • Re: query - select from one, update another | SGreen | 8 Aug |
| • Re: query - select from one, update another | Nuno Pereira | 8 Aug |
| • Re: query - select from one, update another | Michael Stassen | 8 Aug |
| • Re: query - select from one, update another | Jasper Bryant-Greene | 8 Aug |
| • Re: query - select from one, update another | Michael Stassen | 8 Aug |