Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJacques Kilian
1,403 PointsII am concatenating three columns and are struggling with the email in the following format <jacques@kil.co.za>.
When I concatenate and have to change the format of for instance the email address, how do I go about. I retrieved the three columns as I should but missing the correct format.
6 Answers
Patrik Horváth
11,110 Pointsgive link to task :)
nut you can Combine multiple Data Sources by using " || " maybe code below helps :)
SELECT a_name || " " || a_last_name || " " || adress AS UserData FROM table;
in your case
SELECT "<" || email || ">" FROM table;
Patrik Horváth
11,110 PointsProblem is "." delete it from end :) i had same issiu :D when i was in this challange
where ?
<" || email || ">." <- HERE REMOVE "."
Jacques Kilian
1,403 Pointsto_fields Andrew Chalkley andrew@teamtreehouse.com. Dave McFarland dave@teamtreehouse.com. Alena Holligan alena@teamtreehouse.com. Michael Poley michael@teamtreehouse.com.
Jacques Kilian
1,403 PointsSorry I am still not winning should I only remove the . from the end. This is hwat my query is like and still no luck.
SELECT first_name || " " || last_name || " <" || email || ">" AS to_fields FROM patrons;
Patrik Horváth
11,110 PointsYour SQL Query is good :) but AS to_field no to_fields :), so you think good but misstyping :) keep moving on :)
SELECT first_name || " " || last_name || " <" || email || ">" AS to_field FROM patrons;
Jacques Kilian
1,403 PointsThank you Partik, I appreciate the help. Need to pay more attention to what is required.
Jacques Kilian
1,403 PointsJacques Kilian
1,403 PointsThank you Patrik
The Question is: 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 andrew@teamtreehouse.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.
Below is my query with the results which looks correct to me yet it is saying my query is incorrect.
to_fields Andrew Chalkley andrew@teamtreehouse.com. Dave McFarland dave@teamtreehouse.com. Alena Holligan alena@teamtreehouse.com. Michael Poley michael@teamtreehouse.com.