How to concatenate multiple results into one column in oracle?

Member

by darion , in category: MySQL , a month ago

How to concatenate multiple results into one column in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by samara , a month 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.