Re: Oracle CASE
Date: Tue, 24 Feb 2009 06:07:54 -0800 (PST)
[Quoted] On Feb 23, 3:35 pm, Gints Plivna <gints.pli..._at_gmail.com> wrote:
> On 23 Febr., 20:30, Mtek <m..._at_mtekusa.com> wrote:> Can you have multiple conditions in the WHEN clause of a CASE
> > statement?
> > CASE v_subproduct_id
> > WHEN 197 OR 95 THEN
> case v
> when 197 then 'x'
> when 95 then 'x'
> case when v = 197 or v = 95 then 'x'
> Gints Plivnahttp://www.gplivna.eu
Well, both the 197 & 95 will execute the same code, there is no reason to code them separately......so, I guess #2 is the way to go. I just hate having to re-state the variable I am testing over and over again in each condition...... Received on Tue Feb 24 2009 - 15:07:54 CET