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 trialCoders Unlimited
10,112 PointsSelect the first letter of the "first_name", add a period after it, followed by a space and add the "last_name". Also, convert "last_name" to upper case. Call it "name". Example: "A. CHALKLEY".
I have try this many times ......what is wrong with query ................please help me.............. SELECT CONCAT((SUBSTRING(first_name),1,1), ". ",(UPPER(last_name))) AS name FROM users i received error as like this Bummer! There's something wrong with your SQL statement. Please review your code and try again.
3 Answers
jason phillips
18,131 PointsSELECT CONCAT(SUBSTRING(first_name,1,1), ". ",UPPER(last_name)) AS name FROM users;
Jose Torres
12,947 PointsStrip away some extra parenthesis you've got there. Try:
SUBSTRING(first_name, 1, 1)
and look at
CONCAT(string1, string2, string3)
it should have no parenthesis around string 1 or 2.
Lexis Hamilton
10,181 PointsI originally had nearly the same answer you had. However, there were a couple minor changes that I made - I removed some parentheseis from the beginning and end of the various parts. I also added a space between the period and last_name.
SELECT CONCAT(SUBSTRING(first_name,1,1), ". ", " ",(UPPER(last_name)) AS name FROM users;