RE: Group by and Count query

2003-06-11 Thread Andrew Braithwaite
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

Re: Group by and Count query

2003-06-11 Thread Ryan McDougall
> > 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

Re: Group by and Count query

2003-06-11 Thread Mithun Bhattacharya
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

Group by and Count query

2003-06-11 Thread Karl J. Stubsjoen
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