Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

Concat With +

Example

Combine two strings into a single string.

SELECT ‘W3Schools’ + ‘.com’;

Definition and Usage

The + operator in SQL allows you to concatenate (join) two or more strings together.

Note: Also consider using the CONCAT() and CONCAT_WS() functions for string concatenation.

Syntax

string1 + string2 + string_n

Parameter Values

Parameter

Description

String1, string2 string_n

Mandatory. Specifies the strings to concatenate together.

Technical Details

Works in:

SQL Server (from 2005 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse

More Examples

Example

Combine three strings into one:

SELECT ‘SQL’ + ‘ is’ + ‘ fun!’;

Example

Concatenate strings with each string separated by a space character.

SELECT ‘SQL’ + ‘ ‘ + ‘is’ + ‘ ‘ + ‘fun!’;