List:General Discussion« Previous MessageNext Message »
From:Jasper Bryant-Greene Date:August 8 2005 8:25pm
Subject:Re: query - select from one, update another
View as plain text  
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 anotherSebastian8 Aug
  • Re: query - select from one, update anotherGleb Paharenko8 Aug
    • Re: query - select from one, update anotherEnrique Sanchez Vela8 Aug
      • Re: query - select from one, update anotherGleb Paharenko8 Aug
    • Re: query - select from one, update anotherSebastian8 Aug
      • Re: query - select from one, update anotherSGreen8 Aug
        • Re: query - select from one, update anotherNuno Pereira8 Aug
          • Re: query - select from one, update anotherSebastian8 Aug
            • Re: query - select from one, update anotherSGreen8 Aug
            • Re: query - select from one, update anotherNuno Pereira8 Aug
              • Re: query - select from one, update anotherSGreen8 Aug
        • Re: query - select from one, update anotherNuno Pereira8 Aug
      • Re: query - select from one, update anotherMichael Stassen8 Aug
        • Re: query - select from one, update anotherJasper Bryant-Greene8 Aug
          • Re: query - select from one, update anotherMichael Stassen8 Aug