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

Gregory Ledger
Gregory Ledger
6,116 Points

email disappears in string, yet task shows completed

Challenge Task 1

SELECT first_name || " " || last_name || " <" || email || ">" AS "to_field" FROM patrons;

returns the first name and last name as string but the email part disappears. When I chekc the workd it shows a column with to_field as column label, and the first_name last_name concatenation, but no email and also indicates that I passed (Nice Work)

Does the greater than sign need to be an entity for the email to show?

2 Answers

Seth Kroger
Seth Kroger
56,413 Points

It's a display issue, not a problem with the output. The output is perfectly valid format to use in an email header but it's using the same angle brackets that HTML tags use. Here's a snippet of the output your browser gets:

            <tr>
                  <td>Andrew Chalkley <andrew.chalkley@teamtreehouse.com></td>
            </tr>

The browser interprets the bracketed email as a html tag and doesn't show what's inside it. To show it here, yes you can use entities but it will fail the challenge because it's checking for < not &lt; (Email predates HTML by quite a bit and HTML entities are not valid formatting here.)