Hi,Could you please help me out to compare 2 comma-separated columns(previous_code¤t_code) and split the dropped values into DROPPED_CODEĀ column.I'm working on 11g.Here I have given sample table and data as well.
Create table t1
(id number(10),
previous_code varchar2(200),
current_code varchar2(200),
dropped_code varchar2(200)
);
insert into t1 values (1,'ABC,CDE,FGH','ABC,CDE',NULL);
insert into t1 values(1,'ABC,CDE,FGH','ABC',NULL);
insert into t1 values (1,'ABC,CDE,FGH','CDE',NULL);
COMMIT;
I have to compare PREVIOUS_CODE & CURRENT_CODE Column values and update into DROPPED_CODE field as below.
ID
| PREVIOUS_CODE
| CURRENT_CODE | DROPPED_CODE |
|---|
| 1 | ABC,CDE,FGH | ABC,CDE | FGH |
| 2 | ABC,CDE,FGH | ABC | CDE,FGH |
| 3 | ABC,CDE,FGH | CDE | ABC,FGH |
Thanks,
Jai