Re: How to filter zeroes in select statements

From: Michael Krolewski <mkrolews_at_upw.com>
Date: 1996/06/04
Message-ID: <31B435E0.7FE0_at_upw.com>#1/1


Magnus Nyborg wrote:
>
> Use the DECODE function ...
>
> //Magnus Nyborg
> email: many_at_lkp.ifsab.se
>
> On den 28 maj 1996, Neal Gran wrote...
> > I am trying to code a select statement in which one numeric field may
 

> > take a value from one of two sources, s1 and s2. The condition is
 whether
> > s1 is zero or not. I need something like the 'nlv' function,
> > except for a zero value of s1 instead of a null value. I haven't found
> > anything helpful in the Oralce SQL manual. Does anyone have any
> > suggestions for this problem?
> >
> > -Neal Gran
> >
> >

	decode ( s1,
		0,	condition1,
		condition2 )

	It works like a case statement

	switch (s1)
		case 0: condition1
		case ...
	else
		condition2

	Note: condition1 and condition2 can be anything including
	constants, literals, other fields, etc.

Mike Krolewski Received on Tue Jun 04 1996 - 00:00:00 CEST

Original text of this message