Re: Counting propositions
From: --CELKO-- <jcelko212_at_earthlink.net>
Date: 20 Jun 2004 16:51:27 -0700
Message-ID: <18c7b3c2.0406201551.63fe67a5_at_posting.google.com>
Date: 20 Jun 2004 16:51:27 -0700
Message-ID: <18c7b3c2.0406201551.63fe67a5_at_posting.google.com>
>> What is the difference between COUNT(*) and COUNT(<exp>) ? <<
Thus
COUNT (salary)
COUNT (salary + commission)
can surpise you when "commission IS NULL" for non-sales personnel;
the expression (salary + commission) will be dropped. You might have
meant
COUNT (salary + COALESCE(commission, 0.00).
you can also use SUM(CASE WHEN <pred> THEN 1 ELSE 0 END) to do a lot of work in aq single query. Received on Mon Jun 21 2004 - 01:51:27 CEST