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!
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
Michael Martin8,647 Points
This statement works in SQL Playground, aliasing three values as to_field, what am I doing wrong with this question?
select first_name || " " || last_name || " " || "<" || email || ">" as "to_field" from patrons where first_name = "Andrew"
What is wrong with this query? if I change the variables around, it works just fine in the playground, am I misunderstanding what to alias it to/as?
You've got a "" in between the last_name and the '<' where there shouldn't be one. In the playground it wont matter as it will just bring back the results. However, in the task it is asking for specific results so it will see that extra space and automatically think it's wrong.
try and compare your task to this. I have tested the code below and know this works.
SELECT first_name || " " || last_name || ' <' || email || '>' AS to_field FROM patrons;