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 SQL Basics Getting Data from a Database Categorizing Your Output with 'AS'

Erin Clayton
Erin Clayton
3,840 Points

What's wrong with this code? Looks good to me?

SELECT home_team AS "Home Team", home_score AS "Home Score", away_team AS "Away Team", played_on AS "Date Played", away_score AS "Away Score" FROM results;

2 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi Erin, you're code is technically correct, however the code challenge requires the columns be in a particular order which is: home_team, home_score, away_team, away_score, played_on

Hope that helps!!!

Erin Clayton
Erin Clayton
3,840 Points

Thanks... so you are saying in regular SQL order doesn't matter, right? But in Treehouse's SQL it is coded to where it has to go in order?

Okay. Got it.

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Nothing really wrong with your code but the challenge is looking for a specific order for the variables and is providing a confusing error message about selecting from the "results" table.

Make sure you order the SELECT variables in the exact order in the challenge and it will be accepted.