create table nps(nps_key number, pname varchar2(10), svalue varchar2(10));
insert into nps values(1,'Paramx','4,5,6');
create table np_data(nps_key number, tstamp date, pvalue varchar2(10));
insert into np_data values(1,sysdate,'4,4,6'); --good match
insert into np_data values(2,sysdate,'4,4,4'); --good match
insert into np_data values(3,sysdate,'4,6,5,5'); --bad match due to 4 characters instead of 3
insert into np_data values(4,sysdate,'6,4,4'); --good match
--what I would do if the standard value (svalue) was a simple one to one match with a parameter value (pvalue)
select *
from nps a,
np_data b
where a.nps_key = b.nps_key
and b.pvalue = a.salue -- for example 4 = 4
But in this example the standard value is a string with three characters that can be any permutation of the numbers listed.
Suggestions?
Thanks,
Patrick