OracleProgrammerwith
Programmer
Hi All ,
I want to write a case statement in where clause such that if
Value is TAG1 then in where clause it will search for TAG2 and TAG3.
Value is TAG2 then in where clause it will search for TAG1 and TAG3.
Value is TAG3 then in where clause it will search for TAG2 and TAG1.
if (v_temp_counter = v_tag_id_1 or v_temp_counter = v_tag_id_2 or v_temp_counter = v_tag_id_3)
then
select v_agg_data(rmu_id,NULL,NULL,risk_seq_no,risk_scenario_id)
bulk collect into v_risk_with_2_3
from erm_rpr_risk_dtls_t
where rmu_id=v_rmu_without_both_tags(v_cntr).rmu_id
and tag_id in
case when v_temp_counter = v_tag_id_1 then (v_tag_id_2,v_tag_id_3)
when v_temp_counter = v_tag_id_2 then (v_tag_id_1,v_tag_id_3)
when v_temp_counter = v_tag_id_3 then (v_tag_id_1,v_tag_id_2)
end;
end if;
I want to write a case statement in where clause such that if
Value is TAG1 then in where clause it will search for TAG2 and TAG3.
Value is TAG2 then in where clause it will search for TAG1 and TAG3.
Value is TAG3 then in where clause it will search for TAG2 and TAG1.
if (v_temp_counter = v_tag_id_1 or v_temp_counter = v_tag_id_2 or v_temp_counter = v_tag_id_3)
then
select v_agg_data(rmu_id,NULL,NULL,risk_seq_no,risk_scenario_id)
bulk collect into v_risk_with_2_3
from erm_rpr_risk_dtls_t
where rmu_id=v_rmu_without_both_tags(v_cntr).rmu_id
and tag_id in
case when v_temp_counter = v_tag_id_1 then (v_tag_id_2,v_tag_id_3)
when v_temp_counter = v_tag_id_2 then (v_tag_id_1,v_tag_id_3)
when v_temp_counter = v_tag_id_3 then (v_tag_id_1,v_tag_id_2)
end;
end if;