Re: Decode based on two fields

From: (wrong string) é Nicolau <jnicolau_at_hotmail.com>
Date: 1998/08/16
Message-ID: <35D6B9D9.9E3F16A5_at_hotmail.com>#1/1


Is not tested, but try that:

select decode(schoolcode||major, 'GRCS', 'SS', 'GRMBA', 'BU', 'GRBA', 'BU')
from table;

Jay Barbee wrote:

> Hello all,
>
> I wanted to write a simple decode statement from a program. Basically
> I have a list of school codes which I simply want to narrow down the
> the 14 major colleges in the university. However, I have one entry
> that could belong to 1 of two schools based on the major of the
> student.
>
> SchoolCode = SS if (SchoolCode = GR AND Major = CS)
> OR
> SchoolCode = BU if (SchoolCode = GR AND Major = MBA OR BA)
>
> As you can see SS and BU are major colleges in the university. GR
> (Graduate School) is more or less a misc division, and the MAJOR field
> is the determining factor (CS -> SS) or (MBA,BA -> BU).
>
> Is there anyway to decode a field based on two other fields?
>
> Thanks,
> --Jay Barbee
> jybarb01!_at_homer.louisville.edu
> [NOTE: Remove '!' for valid email address]
> Jay Barbee
> jybarb01!_at_homer.louisville.edu
> [ANTISPAM, remove "!" from address above...]
Received on Sun Aug 16 1998 - 00:00:00 CEST

Original text of this message