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

Dan Sullivan
PLUS
Dan Sullivan
Courses Plus Student 7,591 Points

Code Challenge pt 2: SQL reports String Concatenation. I'm stuck!

Have tried the aliases with and without quotes, have done the commas and spaces combined and separate but nothing still works.

SELECT street AS "Street" || ", " || city AS "City" || ", " || state AS "State" || ", " || zip as "Zip" || ". " || country as "Country" AS address FROM addresses;

error message is: SQL Error: near "||": syntax error

1 Answer

Dan Sullivan
PLUS
Dan Sullivan
Courses Plus Student 7,591 Points

Started to do it that way but could never get it to work. Found out the problem was the ". " after the zip code. Had not noticed that period as part of the required concatenation. I'll bet the other users that have posted about this code challenge were having the same issue. Thanks for the help!