In Teradata concatenation operator is used as || like other relational databases like SQL, MySQL etc.
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
- 86 reads