Re: trivial decode NOT

From: Daryl Erwin <derwin_at_mach2.wlu.ca>
Date: 1995/04/12
Message-ID: <D6xH5E.K22_at_info.uucp>#1/1


In article <1995Apr10.023232.7674_at_madnix.uucp> febbo_at_madnix.uucp writes:
>Mark W. Aurit (maurit_at_world.nad.northrop.com) wrote:
>: Im creating a view, and need to add a new column "Acct_Desc".
>: The pseudo code behind the new column is (roughly)
 

>: if acct ge '120' and acct le '140' then 'Labor'
 

>: Would greatly appreciate any help on how to do this in a decode
>: (unless anyone knows any other ways!)
 

>: Mark
>: maurit_at_world.nad.northrop.com
>
>Hi Mark, here is the DECODE to identify a column value between
>'150' and '160'.
>

<cut cut>
Nice. But you changed the original question?!

How about ....

   decode(least(acct,120), 120, /* acct is greater equal to 120 */

               decode(least(acct,139), acct, /* acct is less than 140 */
                               'labor',
                           'acct is 140 or greater'),
                   ' acct is less than 120 ')


Replace the 'acct is ..' stuff with further decodes....

--
Daryl Erwin                                     Net Address: derwin_at_mach2.WLU.CA
Information Systems                             Surface Mail: P4-10, Main Campus
Wilfrid Laurier University, Waterloo, Ontario 
Bus:(519) 884-0710 x3910                                     Ah...Go fly a kite!
Received on Wed Apr 12 1995 - 00:00:00 CEST

Original text of this message