I need to split single record into multiple record with columns that are not null.
Below is the table
Expected result
Scenario :
- col1 to col4 acts as primary key i need col5 to col7 in each row.
- col5 to col7 null values and 0 values should be ignored
Here is the query:
create table TABLE_1 (
col1 number,
col2 number,
col3 number,
col4 number,
col5 number,
col6 number,
col7 number
);
insert into TABLE_1 values (100,101,102,103,1000,NULL,1002);
insert into TABLE_1 values (200,201,202,203,2000,2001,NULL);
insert into TABLE_1 values (300,301,302,303,NULL,3001,3002);
insert into TABLE_1 values (400,401,402,403,4000,NULL,4002);