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

veronica stupia
veronica stupia
94 Points

I keep on getting an SQL error when typing my code ! SELECT * addresses FROM customer_addresses;

I don't understand what is wrong with my query: Select all addresses from the customer_addresses table.

SELECT * addresses FROM customer_addresses;

Hi Veronica,

If "addresses" is the name of the column, have you tried "SELECT addresses FROM customer_addresses;" without the asterisk?

veronica stupia
veronica stupia
94 Points

Cara, yes I have tried without the asterisk and I am still getting an invalid error

If you don't mind telling me where to find the challenge, I'll give it a try.

veronica stupia
veronica stupia
94 Points

yes, on the SQL Basics video part 3 challenge task number 3. Thank you Cara!

veronica stupia
veronica stupia
94 Points

Thank you Cara! I must have added an extra space before since it was not taking it! I was able to get past the problem Thank you!

Gabriel Plackey
Gabriel Plackey
11,064 Points

In case you wanted for info about why your original query didn't work. The all selector (*) cannot be used when also trying to specify and select certain columns. So saying SELECT *(select all columns) and then saying a column to select will throw a syntax error. But because their is not a column named addresses SELECT addresses would throw an invalid column name error. The wording of the challenge doesn't help. They should say select all from customer_addresses. That might be a little more straight forward.

Agreed, the wording is tricky. Congrats on solving it Veronica!

1 Answer

Not 100% sure I have the right challenge, but I believe this is it:

SELECT * FROM customer_addresses;