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 Challenge Task is giving me an error.

SELECT * From patrons, first_name || " " || last_name || " " || email AS "To";

SQL Error: near "||": syntax error

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I feel like you probably aren't supposed to be selecting all columns and your FROM is probably in the wrong place. Could you link the challenge so we can see exactly what you're working on? :smiley:

2 Answers

Cindy Lea
PLUS
Cindy Lea
Courses Plus Student 6,497 Points

I see the problem, you left out the to_field property. Try this:

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

Steven Parker
Steven Parker
231,261 Points

Jennifer has the right idea.

:point_right: You definitely must put the FROM clause after the items being selected. And you won't be using "*" and a custom list at the same time.

And if Cindy has correctly guessed which challenge you are working on, you'll need to modify your items list a bit also.