Re: does a table always need a PK?

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Tue, 2 Sep 2003 18:23:47 -0700
Message-ID: <Xwb5b.22$1o4.1108_at_news.oracle.com>


"Lee Fesperman" <firstsql_at_ix.netcom.com> wrote in message news:3F553E89.5AD9_at_ix.netcom.com...
 > You might replace count(*) with sum(1), but count(a + b) only counts tuples where (a+b)
> is not NULL.

The general rule is: "If you have a problem with null, just add a switch operator":

sum(case when a+b is null then 0 else 1 end) Received on Wed Sep 03 2003 - 03:23:47 CEST

Original text of this message