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 trialDan Epstein
3,233 PointsCan anyone assist with how to order the statement in the first SQL Concatenation code challenge? I kind of got lost.
Here's a link to the location : https://teamtreehouse.com/library/reporting-with-sql/working-with-text/concatenating-text
Dan Epstein
3,233 PointsI started with building on this base: SELECT first_name ||" "|| last_name || " "email FROM patrons;
Where do I place the AS command, and what exactly does the instruction mean, please? "Alias it to to_field. This will be used in the "To" field in email marketing."
I feel kinda redundant, but it's better to get over this now before the real market questions come by :)
6 Answers
KRIS NIKOLAISEN
54,971 PointsDan,
With what you posted above you have the following issues:
1) email doesn't have a hyphen
2) The alias to_field uses an underscore instead of a hyphen
The following passes the challenge:
SELECT first_name || " " || last_name || " <" || email || ">" AS "to_field" FROM patrons;
KRIS NIKOLAISEN
54,971 PointsYour alias should come just after the column(s) being aliased.
SELECT column_name AS alias_name FROM table_name;
Also note the brackets around the email need to be concatenated as well.
Dan Epstein
3,233 PointsI am still missing a piece of the puzzle, should the code look somewhat like this? SELECT first_name||" "||last_name || email AS " " FROM patrons;
What value should I put between the quote marks after AS in that case?
Dan Epstein
3,233 PointsAny chance we can get one of the instructors on the thread? I'm sure that most of my issue stems from not properly understanding the code question/task, to begin with.
Dan Epstein
3,233 PointsThis didn't work as well:
SELECT first_name||" "||last_name||" "||"<"||e-mail||">" AS "to-field" FROM patrons;
I'm just about to give up my subscription and try another paid tutorial program. 10 days are pretty long to be stuck on a single task.
Dan Epstein
3,233 PointsThanks, it all started from the basic misunderstanding of the question.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsBrendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsCan you post the code you've tried so far?