Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases

Kamran Ismayilov
Kamran Ismayilov
5,753 Points

Creating Excerpts

Please help to solve this problem, I can not understand what I am doing wrong.

Steven Parker
Steven Parker
216,121 Points

It would help to know what you're working on. In future, be sure to share a link to the quiz/challenge/video page. And remember to share your code and/or a workspace snapshot!

2 Answers

Steven Parker
Steven Parker
216,121 Points

Normally, I'd give you some hints instead of an explicit spoiler, but since you didn't share your code, it's impossible to know what you were doing wrong. But the challenge wants you to extract the first initial from the first name, so you would use the SUBSTR function to get a string from index 1 with a length of 1. Then, selecting that with an alias and including the last name your query would be something like this:


:warning: SPOILER ALERT


SELECT SUBSTR(first_name, 1, 1) AS initial, last_name FROM customers;
Kamran Ismayilov
Kamran Ismayilov
5,753 Points

Oh thanks you a lot! I think the compiler was confusing me.