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

Christopher Phillips
Christopher Phillips
10,061 Points

Query not correct, but visually, it is returning precisely what is asked. What gives?

Task: 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.

Visually, my query is returning exactly what the task says to return, but it's not correct. Where am I wrong? My query:

select first_name || " " || last_name || " <" || email || "> " as to_field from patrons order by last_name asc;

On a side note, i wasn't able to choose SQL as a location for posting. Shouldn't that be an option?

1 Answer

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

Hi there! I believe you're referring to this challenge. Yes, it's the correct format as far as the string. However, you did something here that the challenge neither asked for nor was prepared to handle exactly. You are ordering your results alphabetically by their last name which means that the results are now in the incorrect order.

Simply removing the order by part, causes this to pass Step 1 of the challenge.

Hope this helps! :sparkles: