![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can you have multiple conditions in the WHEN clause of a CASE statement? * *CASE v_subproduct_id * *WHEN 197 OR 95 THEN either |
#3
| |||
| |||
|
|
On 23 Febr., 20:30, Mtek <m... (AT) mtekusa (DOT) com> wrote:> Can you have multipleconditions in the WHEN clause of a CASE statement? * *CASE v_subproduct_id * *WHEN 197 OR 95 THEN either case v when 197 then 'x' when 95 then 'x' end Or case when v = 197 or v = 95 then 'x' end Gints Plivnahttp://www.gplivna.eu |
#4
| |||
| |||
|
|
On Feb 23, 3:35*pm, Gints Plivna <gints.pli... (AT) gmail (DOT) com> wrote: On 23 Febr., 20:30, Mtek <m... (AT) mtekusa (DOT) com> wrote:> Can you have multiple conditions in the WHEN clause of a CASE statement? * *CASE v_subproduct_id * *WHEN 197 OR 95 THEN either case v when 197 then 'x' when 95 then 'x' end Or case when v = 197 or v = 95 then 'x' end 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......- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
On Feb 23, 3:35 pm, Gints Plivna <gints.pli... (AT) gmail (DOT) com> wrote: On 23 Febr., 20:30, Mtek <m... (AT) mtekusa (DOT) com> wrote:> Can you have multiple conditions in the WHEN clause of a CASE statement? CASE v_subproduct_id WHEN 197 OR 95 THEN either case v when 197 then 'x' when 95 then 'x' end Or case when v = 197 or v = 95 then 'x' end 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...... |
![]() |
| Thread Tools | |
| Display Modes | |
| |