Sunday, March 1, 2015

SQL: Concatenating Columns

Concatenation means combining the value of two or more columns together to form a single value. The most common usage for this operation is to combine the first name and last name field. Like the query below.

SELECT FirstName + ' ' + LastName AS Name
FROM Employees

The query above concatenates the FirstName and LastName column from the Employees table in the Northwind database and assign the alias Name to combined value.

No comments:

Post a Comment