Takyi AkwahPro Student 1,049 Points
Concatenation Challenge Help
In the library database there's a patrons table listing all the users of the library. The columns are id, first_name, last_name, address, email, library_id and zip_code.
Generate a list of strings that are in the following format: Andrew Chalkley email@example.com. Concatenate the first name, last name and email address for all users.
Alias it to to_field. This will be used in the "To" field in email marketing.
Type in your command below, then press Ctrl-Enter.
Bummer: Your query needs didn't retireve the emails in the correct format.
SELECT first_name || " " || last_name || " " || email FROM patrons AS "to_field";
Where am I going wrong?
Jennifer NordellTreehouse Moderator
Hi there! There are a couple of issues here. The first problem is that you have your alias in the wrong spot. The second problem is what I believe is a misunderstanding of the instructions. It actually wants those emails inside the angle brackets which means they also need to be concatenated. The alias should come before the
FROM patrons. This is how I solved it:
SELECT first_name || " " || last_name || " <" || email || ">" AS "to_field" FROM patrons;
If the first name is "Jennifer", the last name is "Nordell" and the email is "firstname.lastname@example.org", then this will print out "Jennifer Nordell
<email@example.com>" complete with the angle brackets inside the "to_field".
Hope this helps!