Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Concatenation
5. The CONCAT() function
Simple text functions
How to modify Strings
Summary

Instruction

Excellent! You can use the + operator to concatenate string values, but it is not the only way to do so. T-SQL also provides the CONCAT() function. You can use values as parameters in this function. They have to be separated by commas.

Here is how to use CONCAT() to join a slogan's ID, type, and copywriter ID:

SELECT
  CONCAT(Id, N' ', Type, N' ', CopywriterId) AS Slogan
FROM Slogan;
a3

Notice that we included spaces as constant values here as well.

Exercise

For each item, show the following sentence:

ID X is Y.

Where X is the Id of the item and Y is its name. Name the column ItemName.

Stuck? Here's a hint!

Use the CONCAT() function with five arguments. Remember to add spaces and a period in the correct places.