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
Modifying strings
Summary

Instruction

Excellent! You can use the || operator to concatenate string values, but it is not the only way. PostgreSQL also provides the CONCAT() function. Here is how to use CONCAT() to join a slogan's id, type, and copywriter_id:

SELECT CONCAT(id, ' ', type, ' ', copywriter_id) AS slogan
FROM slogan;

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 new column item_name.

Stuck? Here's a hint!

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