The '+' operator in SQL Server
Learn how to use the + operator in SQL Server to join two or more strings into a string.
The article will explore and show you how to use the + operator in SQL Server to join multiple strings into a string .
Describe
The + operator in SQL Server is used to join two or more strings into a single large string.
Syntax
To use the + operator in SQL Server, we use the following syntax:
chuoi1 + chuoi2 + chuoi_n
Parameters :
- series1, chuoi2, . cycle : strings want to connect with each other.
Note :
- The + operator is similar to the CONCAT function.
- The + operator can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
Take a look and explore some examples of using the + operator in SQL Server.
SELECT 'Quantrimang' + '.com';
Result: 'TipsMake.com'
SELECT 'Quan' + 'tri' + 'mang' + '.com';
Result: 'TipsMake.com''
SELECT 'Quan ' + 'Tri ' + 'Mang ';
Result: 'Quan Tri Mang'
When combining strings together, you can add whitespace characters to separate your linked values for easier reading.
SELECT 'Orange' + ' ' + 'Peach' + ' ' + 'Apple';
Result: 'Orange Peach Apple'
In this example, Quantrimang used the + operator to add a space character between values Orange, Peach and Apple. This will help the strings not be tied together.
Previous article: CONCAT function in SQL Server
Next lesson: DATALENGTH function in SQL Server
4 ★ | 1 Vote
You should read it
- Operator in programming C
- Overload the one-seat operator in C ++
- Load operator ++ and - in C ++
- Overload subscript operator [] in C ++
- Stack operator in Python
- Operator overload and Load overlap in C ++
- UNION operator in SQL Server
- EXCEPT operator in SQL Server
- Load the Input / Output operator stack in C ++
- Operator overloading in C #
- How to Get Compensation from a BUI Accident
- Wildcard representation operator in Access