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 trialAbdullah Alsowaygh
8,719 PointsSQL concatenation question won't be resolved as correct answer.
A concatenation question in "Reporting with SQL" course asks to concatenate addresses in a database table in a specific format. When I submit my answer, I get incorrect response with the following comment: "Your query didn't retireve the addresses in the correct format. Expecting 2532 2nd ST, San Diego, California 90222. USA not 2532 2nd ST, San Diego, California 90222. USA.
"
When I copy and paste both formats in the correction to my computer's notepad, I find them both to be exactly the same.
My code is as follow:
SELECT street || "," || " " || city || "," || " " || state || " " || zip || "." || " " || country FROM addresses;
I also tried
SELECT street || ", " city || ", " || state || " " || zip || ". " || country FROM addresses;
Can someone please help?
Thank you
1 Answer
Sergey Podgornyy
20,660 PointsYou forgot to write an alias for this query
SELECT street || ", " || city || ", " || state || " " || zip || ". " || country AS address FROM addresses;
Abdullah Alsowaygh
8,719 PointsAbdullah Alsowaygh
8,719 PointsThat was the problem. The error message did not indicate it. Thank you!
Sergey Podgornyy
20,660 PointsSergey Podgornyy
20,660 PointsYou are welcome ;)