ComeçarComece de graça

Concatenating strings

In this exercise and the ones that follow, we are going to derive new fields from columns within the customer and film tables of the DVD rental database.

We'll start with the customer table and create a query to return the customers name and email address formatted such that we could use it as a "To" field in an email script or program. This format will look like the following:

Brian Piccolo <[email protected]>

In the first step of the exercise, use the || operator to do the string concatenation and in the second step, use the CONCAT() functions.

Este exercício faz parte do curso

Functions for Manipulating Data in PostgreSQL

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- Concatenate the first_name and last_name and email 
SELECT ___ ___ ' ' ___ ___ ___ ' <' ___ ___ ___ '>' AS full_email 
FROM customer
Editar e executar o código