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',
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
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',