How to concatenate multiple results into one column in oracle?

Member

by darion , in category: MySQL , 7 months ago

How to concatenate multiple results into one column in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

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

Related Threads:

How to take multiple values from one column in laravel?
How to concatenate arrays grouped by another column in presto?
How to concatenate arrays from multiple documents in mongodb?
How to concatenate fields in oracle?
How to sort column value in mysql when results are grouped?
How to merge results of an union all in oracle?