Flat similar rows on few columns - Oracle I wonder is there any way to flat data like this using sql query
maybe you can help me

The data looks like this:

id  name    customer_code column1 column2
-----------------------------------------
1   Tom      Dilbert        null    text
1   Tom      Dilbert        text2   null   
2   Bob      Wally          text3   null
2   Bob      Wally          null    text4


My results need to look like this:

id  name    customer_code column1 column2
-----------------------------------------
1   Tom      Dilbert        text2   text
2   Bob      Wally          text3   text4
select id, name, customer_code, min(column1), min(column2)
from the_Table
group by id, name, customer_code
order by id;


Note that if there are more rows with non-null columns this would still only return one per combination of id, name and customer_code (but it does return the result in your question)

Edit (after the question was changed)

To get all values for that combination use listagg()

select id, 
       name, 
       customer_code, 
       listagg(column1, ',') within group (order by column1) as col1, 
       listagg(column2, ',') within group (order by column2) as col2
from the_Table
group by id, name, customer_code
order by id;