List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 7 2001 3:57am
Subject:Re: mySQL Counting Question
View as plain text  
At 10:46 PM -0500 11/6/01, abercrombie fitch wrote:
>Hi,
>
>I have a quick counting question.
>
>When I run this query :
>
>SELECT count(*) FROM results
>LEFT JOIN whois_domain ON results.domain=whois_domain.domain
>WHERE whois_domain.domain is NULL
>
>I get a result of say 51 but when I run the query with a group by on the end :
>
>SELECT count(*) FROM results
>LEFT JOIN whois_domain ON results.domain=whois_domain.domain
>WHERE whois_domain.domain is NULL
>GROUP BY results.domain
>
>I end up getting results like
>	5
>	6
>	7
>	2
>	1
>	3
>
>How do I use a group by and still get the total number of rows 
>returned from the
>query ?

You don't.  Run two queries.


>
>Thanks,
>John.

Thread
mySQL Counting Questionabercrombie fitch7 Nov
  • Re: mySQL Counting QuestionPaul DuBois7 Nov
  • Re: mySQL Counting QuestionJames Barwick7 Nov