Debashish Mahonta

Debashish Mahonta

  • 1.6k
  • 164
  • 3.8k

Concatenation Three column with condition

Oct 22 2024 6:02 AM

My datatable

Date Column1 Column2 Column3
01/10/2024 Data1 Data2 NULL
01/10/2024 Data4 Data5 Data7
02/10/2024 Data8 Data9 NULL
02/10/2024 Data1 Data2 NULL

I want to concate Column1 and Column2 into one line if Column3 value is empty or NULL. If Column3 value is not empty or NULL then concate Column3 Only. When Column3 value available it concate only column3. How can i do it like below.

Date Concate
01/10/2024 Data1, Data2
01/10/2024 Data7
02/10/2024 Data8, Data9, Data1, Data2

 


Answers (8)