How to concatenate multiple results into one column in oracle?

Member

by darion , in category: MySQL , 15 days ago

How to concatenate multiple results into one column in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by samara , 14 days ago

@darion 

In Oracle, you can concatenate multiple results into one column using the CONCAT function or the || operator.


Here is an example using the CONCAT function:


SELECT CONCAT(column1, '-', column2, '-', column3) AS concatenated_column FROM your_table;


And here is an example using the || operator:


SELECT column1 || '-' || column2 || '-' || column3 AS concatenated_column FROM your_table;


Both of these queries will concatenate the values from column1, column2, and column3 into a single column called concatenated_column. You can specify any delimiter you want between the values, such as '-', ' ', etc.