Re: COUNT(*) with UNIQUE keyword
Posted in 1996
How about:
SELECT COUNT(DISTINCT cartype)
FROM table-name
It works for me, except NULLs aren't included in the count if the
column value is NULL. Also, the DISTINCT can be substituted with
UNIQUE.
ricky.montgomery@ccmail.irs.com
______________________________ Reply Separator _________________________________
Subject: COUNT(*) with UNIQUE keyword
Author: informix-list-owner@rmy.emory.edu at Internet
Date: 12/28/95 12:01 AM
Hi INFORMIX' er
if I have this kind of table
cartype
MERC
FORD
MERC
MERC
MERC
FORD
select COUNT(*) = 6
select UNIQUE cartype = MERC
FORD
how would I count howmany cartype(S) that I have ...... (i.e. 2)
in 1 select statement...????
thanks......