Re: trivial decode NOT
Date: 1995/04/18
Message-ID: <1995Apr18.221923.28218_at_atlas.com>#1/1
In article <michaelx.28.001408F9_at_leland.stanford.edu> michaelx_at_leland.stanford.edu (Michael G. Barbitta) writes:
>In article <D6L1J7.KBq_at_gremlin.nrtc.northrop.com> maurit_at_world.nad.northrop.com (Mark W. Aurit) writes:
>>From: maurit_at_world.nad.northrop.com (Mark W. Aurit)
>>Subject: trivial decode NOT
>>Date: Wed, 5 Apr 1995 22:09:06 GMT
>>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'
>>if acct ge '150' and acct le '160 or
>> acct ge '170' and acct le '180' then 'Fringe'
>>.. and on and on, but you get the idea
>>Would greatly appreciate any help on how to do this in a decode
>>(unless anyone knows any other ways!)
>>Mark
try
decode(greatest(acct,120),acct,
decode(greatest(acct,140),140,'LAbor',
decode(greatest(acct,150),acct, decode(greatest(acct,180),180,'Fringe',
and so on.
-- Bruce Arbuckle EMAIL: brucea_at_adcmail.atlas.comReceived on Tue Apr 18 1995 - 00:00:00 CEST