You are here

Teradata Concatenation Operator

Submitted by Asif Nowaj, Last Modified on 2019-12-17

In Teradata concatenation operator is used as || like other relational databases like SQL, MySQL etc.

Teradata Concatenation Operator

This concatenation operator is used to concat e.g. join or link two or more strings or columns or character, number etc. This operator is used primarily in SELECT statement of Teradata database SQL.

To join three strings in a SQL statement by using Teradata concatenation operator, you can write

Select ‘every’ || ‘E’ || ‘thing’

Output:

everyEthing

Please note that you can also use CONCAT function or command in Teradata to join or concatenate two or more inputs provided instead of Teradata concatenation operator. Example SELECT CONCAT('everyE','thing')

Consider a table called Person that contains first name and last name, defined as VARCHAR as below. For joining multiple column values within SELECT statement, you can use following:


SELECT first_name, last_name, first_name || ' ' || last_name FROM Person

Output of this query would be


first_name	last_name	first_name || ' ' || last_name
=============================================
Leonardo	DiCaprio	Leonardo DiCaprio
Will		Smith		Will Smith
Brad		Pitt		Brad Pitt

Discussion or Comment

If you have anything in mind to share, please bring it in the discussion forum here.

https://forum.everyething.com/others-f41/