create table mtest (x number,y varchar2(1000), z varchar2(1000));
insert into mtest values(1, '[AB|UUU/WWW|DATA]','[XY|UUU/WWW|DATA1]');
insert into mtest values(2, '[AB|AAA/BBB|DATA]','[TR|UUU/WWW|DATA1]');
insert into mtest values(3, '[AB|CCC/XXX|DATA]','[XY|CCC/XXX|TA1]');
commit;
I am trying to write a case statement that returns Y or N
Y -- compare y and z columns from above, compare the text between first '|' and second '|'
(example, for row 1, UUU/WWW from column y matches with UUU/WWW of column z, so case gives Y
N-- for row 2, AAA/BBB is not equal to UUU/WWW so return N,
how can i find the 1st and 2nd occurance of '|' from above examples for this comparison ?