The '+' operator in SQL Server
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
May be interested
- AND conditions in SQL Serverin sql server, the and condition (or and operator) is used to test two or more conditions.
- Operator overload and Load overlap in C ++c ++ allows you to define more than one definition for a function name or an operator in the scope, respectively called load overloading (function overloading) and load operator overloading in c ++. .
- Load the Input / Output operator stack in C ++c ++ is able to input and output existing data types by using thread extraction operators >> and thread insertion operators
- Operator overloading in C #overloading operator is operator overload. you can redefine or overload most existing operators in c #.
- How to Get Compensation from a BUI Accidentif you were injured in a boating accident, then you can sue the boat operator who caused the injury. for example, the operator may have hit your own boat, or you may have been in the boat with the operator who was intoxicated. either way,...
- Stack operator in Pythonyou can change the meaning of the operator in python depending on the operand used and we call that operator overloading. quantrimang will learn more about this content through the article. invites you to read the track.
- OpenAI Announces Operator, an AI Agent That Automatically Performs Tasks on User's Behalfthe company behind chatgpt is unveiling a new way to use ai. openai has just announced operator, an ai agent that can automatically perform tasks for you.
- The difference between web server and app serveryou have probably seen that the terms web server and app server are often used interchangeably as if they are related to the same thing and also facilitate the website to function properly. but in reality, they are not the same.
- Network basics: Part 3 - DNS Servera dns server is a server that contains a database of public ip addresses and hostnames associated with them. in most cases, the dns server is used to resolve or translate those common names into ip addresses as required.
- Wildcard representation operator in Accesswildcard, also known as a wildcard, can be used to determine the location of a specific item when you don't remember exactly how it was written.