Concatenate/ Alias 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.
My answer: SELECT first_name || last_name || email AS to_field FROM patrons;
I am getting this question wrong what am I doing wrong, could someone explain please?
Jonathan GrieveTreehouse Moderator 81,659 Points
Try including the angle brackets
< > around the email address in your answer. The format needs to look exactly like as indicated in the challenge question.
Good luck :)
I rewrote my answer as such: SELECT <first_name> || <last_name> || <email> AS to_field FROM patrons; I still am getting it wrong I'm not sure what it is
In words, that makes sense to me so I have re written the formula as such: SELECT first_name || " " || last_name || " " || <email> AS to_field FROM patrons;
But I'm still getting this wrong
You need to concatenate the brackets, without spaces, not just throw them around the name of the column you're hoping to change. Every character you're adding needs to be concatenated separately -- <email> isn't a column in the table and so it will error on you.
You're almost there!