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 trial

Databases

Bummer! Your query needs didn't retireve the emails in the correct format. Get Help Try Again

whats wrong with this

select id, first_name || " " || last_name || "< " || email || ">" as "To", address,library_id,zip_code from patrons;
id  To  address library_id  zip_code
1   Andrew Chalkley< andrew.chalkley@teamtreehouse.com> 1234 NE 20st St MCL1001 90210
2   Dave McFarland< dave.mcfarland@teamtreehouse.com>   5252 NW 2nd St  MCL1010 90210
3   Alena Holligan< alena.holligan@teamtreehouse.com>   1404 SW 101st St    MCL1100 91210
4   Michael Poley< michael.poley@teamtreehouse.com> 7070 NE 10th Ave    MCL1011 91310

3 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi there,

I'd need to see the question to be sure but I suspect it's a simple string combination issue with how the results are actually displayed.

My suggestion is to have a space before the last_name field so

select id, first_name || " " || last_name || " <" || email || ">" as "To", address,library_id,zip_code from patrons;

makes this

 Andrew Chalkley <andrew.chalkley@teamtreehouse.com> 1234 NE 20st St MCL1001 90210

By the way you can also checkout the markdown cheatsheet for some help on formatting your code in the forums. Jope this helps :)

thank you let me try

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.