Hi Gurus,
I am trying to write one query which is something similar structure below.
I am trying to run 'condition_3' only for certain groups (lets say for group_num in ( 'aaa', 'bbb', 'ccc'))
For other groups I don't need that condition.
select col1, col2 ,group_num, .....
from tab1, tab2, tab3
where condition_1
and condition_2
and condition_3 ;
Is there a way to obtain that in a same select by case statement? or any other way?
select col1, col2 ,group_num, .....
from tab1, tab2, tab3
where condition_1
and condition_2
and case when group_num in ('aaa','bbb','ccc') then
1=1
else condition_3
end;
Thanks