om: Mithun Bhattacharya [mailto:[EMAIL PROTECTED]
Sent: Wednesday 11 June 2003 18:05
To: MySQL Mailing List
Subject: Re: Group by and Count query
What about
SELECT COUNT(DISTINCT(host)) FROM TABLE_HOST WHERE path_a="";
Mithun
Karl J. Stubsjoen wrote:
> Hello,
> I am trying to
> > Here is the query I'd like to run (which fails - but is exactly what I need
> > for a query):
> > select sum(count(host)) from TABLE_HOST where path_a='' group by host
well I think this one fails because count only ever returns one number
(correct?). So I would think sum would take in a stre
What about
SELECT COUNT(DISTINCT(host)) FROM TABLE_HOST WHERE path_a="";
Mithun
Karl J. Stubsjoen wrote:
Hello,
I am trying to count the number of unique records that exist in my database
based on a given criteria. My table looks like this:
TABLE_HOST
id
host
path_a
path_b
The field host will
Hello,
I am trying to count the number of unique records that exist in my database
based on a given criteria. My table looks like this:
TABLE_HOST
id
host
path_a
path_b
The field host will have duplicates like:
myway.com
hisway.com
hisway.com
hisway.com
someway.com
someway.com
yourway.com
The