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 have duplicates like:


myway.com
hisway.com
hisway.com
hisway.com
someway.com
someway.com
yourway.com

The given criteria is:  only count the records where path_a is blank
(path_a='')

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

This is the next query I tried... (nothing distinct about the result of a
count)
select distinct count(host) from TABLE_HOST where path_a=''


So, is it possible to perform this query? Karl




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to