hi
well,
one way to do it is to create a stored function
create
or replace package pkg_select
is
function cmb(p1 varchar2, p2
varchar2)
return
varchar2;
end;
create
or replace package body pkg_select
is
function cmb(p1 varchar2, p2
varchar2)
return
varchar2
is
begin
if p1 = 'A' and instr(p2, 'A|B|C|D|E') >0 then
return 'TRUE';
elsif p1 = 'B' and instr(p2, 'A|B|C|D|E|F|G|H|etc...') >0
then
return 'TRUE';
else
return 'FALSE';
end if;
exception
when others then
return SQLERRM;
end
cmb;
end
pkg_select;
then
do
select col1, col2 from table1 where
pkg_select.cmb(col1, col2) = 'TRUE';
This
keeps your select nice and simple, also you can create a function-based index to
give fast performance.
Rgds
Greg
|
- querry.. Saurabh Sharma
- Re: querry.. Diana_Duncan
- Re: querry.. Greg Solomon
- Re: querry.. Pritam
- RE: querry.. Bala, Prakash