This is what I am trying to achieve -
Consider below table
CREATE TABLE SAMPLE_TAB
(
COL1 NUMBER,
COL2 NUMBER
)
Data is as follows -
INSERT INTO sample_tab
VALUES (1 ,3);
INSERT INTO sample_tab
VALUES (3 ,4);
INSERT INTO sample_tab
VALUES (5 ,8)
INSERT INTO sample_tab
VALUES (8 ,12);
INSERT INTO sample_tab
VALUES (13 ,15);
INSERT INTO sample_tab
VALUES (16 ,20);
Actual Data
COL1 COL2 1 3 3 4 5 8 8 12 13 15 16 20
If you notice, the data has some overlapping between col2 and col1 example Row 1 Col2 ( data 3) overlaps with Row 2 Col1 (data 3 again), row 3 col2 (data 8) overlaps with row 4 col1 (data 8 again).
If we see such overlaps, we need to combine the over lap and the final output should be as follows
Expected result
COL1 COL2 1 4 5 12 13 15 16 20
Any ideas how to achieve this?
Thanks, S.