Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge (combine) 2 columns into 1 in oracle?

Tags:

merge

sql

oracle

I have 3 textfields where user types table name and 2 column names which need to be merged.

How should I merge (combine) 2 column values into 1?

I use oracle 11g enterprise

like image 200
abekmuratov Avatar asked Nov 28 '13 14:11

abekmuratov


People also ask

How can I merge two columns in a single column in Oracle?

Oracle String concatenation allows you to append one string to the end of another string. To display the contents of two columns or more under the name of a single column, you can use the double pipe concatenation operator (||).

How do I merge two columns in PL SQL?

Do it with two concats: select concat(concat(amt, '-'), endamt) as amount from mstcatrule; concat(amt,'-') concatenates the amt with the dash and the resulting string is concatenated with endamt .

What is merge command in Oracle?

Merge is one statement that allows you to do either an insert or an update as needed. To use it, you need to state how values in the target table relate to those in the source in the join clause. Then add rows in the when not matched clause. And update them using when matched.

What is collate in Oracle?

Column-Level Collation and Case-Insensitive Database in Oracle Database 12c Release 2 (12.2) Collation determines how strings are compared, which has a direct impact on ordering (sorting) and equality tests between strings.


1 Answers

concatenate?

select col1 || ' ' || col2 from tablex
like image 150
Randy Avatar answered Sep 25 '22 08:09

Randy