Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: does a table always need a PK?

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@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 Tue Sep 02 2003 - 20:23:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US