Hi there,
May be this is a popular issue.... but this is the first time for me. Any
ideas are appreciated.
how do I change the right hand side input in 'Where' clause, based on some conditions? There could be more one conditions in 'case' clause
Please help,
May be this is a popular issue.... but this is the first time for me. Any
ideas are appreciated.
Code:
select *
from Table1 as t1
left outer join Table2 as t2
on t1.id = t2.id
and t2.type in (case when <condition>
then (1,2,3,4)
else 1
end)
Code:
case when <cond1> then
(2,6,3,1)
when <cond2> then
(7,4,9,1)
...
...
...
else 1 -- 1 is default option
end
Please help,