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 Reporting with SQL Working with Text Concatenating Text

I'm on Challenge Task 1 of 2 on Reporting with SQL. Why won't it pass?

We are to concat the first name, last name and email address in this format:

Andrew Chalkley andrew@teamtreehouse.com

and report it as "to_field"

Here is my code:

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

When I put it in the SQL Playground using the customers table like this:

SELECT first_name || ' ' || last_name || '  <'|| email || '>' AS "to_field"
FROM customers
ORDER BY last_name
LIMIT 1;

It returns "Andrew Chalkley Andrew@teamtreehouse.com" in a column labeled "to_field".

Seems right no? Am I missing something?

1 Answer

Bramyn Payne
Bramyn Payne
19,589 Points

It looks like you have an extra space in the ' <' element which is throwing of the formatting. Other than that it should be correct.