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

Marcia Haledjian
Marcia Haledjian
7,562 Points

What is wrong with my statement

Reporting with SQL

Challenge Task 1 of 1

Bummer! Expecting results like L & Chalkley not L & Chalkley.

SELECT SUBSTR(first_name, 1, 1) || " & " || last_name AS initital FROM customers;

initital L & Chalkley D & McFarland P & Premaratne A & Chalkley R & Hinkley L & Love N & Pettit C & Tepper J & Hoskins M & Poley

I am getting the desire result and the challenge keep telling me I am wrong

2 Answers

Simon Coates
Simon Coates
28,694 Points

Assuming, this is for https://teamtreehouse.com/library/reporting-with-sql/working-with-text/creating-excerpts , in which case try

SELECT SUBSTR(first_name,1,1) AS initial, last_name FROM customers;

(if this is what you want, you might care to upvote Alexander Nikiforov at https://teamtreehouse.com/community/getting-the-correct-result-but-says-bummer - which is where i found the answer. I googled the error message you posted.)

Aananya Vyas
Aananya Vyas
20,157 Points

'''SELECT SUBSTR(first_name,1,1) AS initial , last_name FROM customers;'''