Re: How do I use COUNT() and DISTINCT together?

2003-02-20 Thread Mervyn Chapman
2003 12:03 AM Subject: How do I use COUNT() and DISTINCT together? > Given this table, I want to count the number of distinct targetranges. > > CREATE TABLE job ( > job_id int(10) unsigned NOT NULL auto_increment, > customer_id int(10) unsigned NOT NULL default '0',

Re: How do I use COUNT() and DISTINCT together?

2003-02-20 Thread Zak Greant
Hi David, Use: SELECT COUNT(DISTINCT targetrange) FROM job; Cheers! On Thu, Feb 20, 2003 at 09:03:29PM -0800, Daevid Vincent wrote: > Given this table, I want to count the number of distinct targetranges. > > CREATE TABLE job ( > job_id int(10) unsigned NOT NULL auto_increment, > cust

How do I use COUNT() and DISTINCT together?

2003-02-20 Thread Daevid Vincent
Given this table, I want to count the number of distinct targetranges. CREATE TABLE job ( job_id int(10) unsigned NOT NULL auto_increment, customer_id int(10) unsigned NOT NULL default '0', scanner_id int(10) unsigned NOT NULL default '0', status_id int(10) unsigned NOT NULL default '0',