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 trialMichael Dinkins
9,483 PointsIn an ecommerce database there's a customers table with id, username, first_name, last_name, password, email and phone c
SELECT SUBSTR(first_name, 1, 1) || " & " || last_name AS initial FROM customers;
What did I do wrong?
Michael Dinkins
9,483 Points4 Answers
J.D. Sandifer
18,813 PointsYou have the right idea, you're just doing more than this problem actually wants. To clarify, what it wants you to do is:
Select 2 things: first initial of the first name and the last name, and alias one of them: first initial as initial.
The result should be a table with two columns like this:
initial last_name
A Smith
J Jones
B Franklin
Michael Dinkins
9,483 PointsI still dont understand, when i run it i get the error : Bummer! Expecting results like L & Chalkley not L & Chalkley. ;
I think the problem is because of the column
Farnoosh Johnson
7,887 PointsSELECT SUBSTR(first_name, 1, 1) AS initial , last_name AS last_name FROM customers;
Michael Dinkins
9,483 PointsOh so you dont need the '&' between the initial and last name. I got it now .. The wording of the error message confused me.
horus93
4,333 PointsAlso, something to note, it's unnecessary to alias last_name as anything, because the challenge doesn't ask for an alias, and aliasing it as itself like "last_name AS last_name" is redundant and changes nothing.
Steven Parker
231,248 PointsSteven Parker
231,248 PointsCan you provide a link to the challenge itself?