Re: Is there a simplified code than this?

From: John P. Early <jpe1_at_lehigh.edu>
Date: Thu, 01 Jul 1999 17:10:50 -0400
Message-ID: <377BD959.64D3CDC2_at_lehigh.edu>


"yvette.millington" wrote:

> Qingbo Zheng wrote in message <3778D682.F60D6F74_at_udel.edu>...
> >UPDATE cadsrdb.population
> >SET births = NULL,
> . . .
> >where births = 0 OR
> > deaths = 0 OR
> . . .
>
> >UPDATE cadsrdb.population
> >SET births = DECODE(births,0,NULL,births)
> etc . . . saves little in typing, but does get rid of the OR in the where
> clause, and maybe looks more comprehensible

and does something different!
Qingbo's example will set ALL the fields to NULL if ANY of the fields equal 0.
Yvette's example will set EACH field to NULL iff that particular field equals 0.

Qingbo, I suspect that Yvette's technique is what you really want.

John.

--
John Early      jpe1_at_lehigh.edu     x85066
Senior Programmer, Enterprise Systems Implementation
Lehigh University, Bethlehem, Pennsylvania
qotd: "Whereof one cannot speak, thereof one must be silent." (Wittgenstein)
Received on Thu Jul 01 1999 - 23:10:50 CEST

Original text of this message