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 trialJessica Carey
690 PointsSQL command error
Find all the matches in the results table where "Hessle" was playing away as the away team and if they played on or after October 1st 2015. Date format is "YYYY-MM-DD".
My command: SELECT * FROM results WHERE "Hessle" = away_team AND away_team >= "2015-10-01";
Steven Parker
231,248 PointsIn an equality comparison, the order of the comparitors is not important.
2 Answers
Steven Parker
231,248 PointsIt looks like you're comparing the wrong field.
Your WHERE
clause combines two comparisons, and the the second one is for a date. But you're using the same field in both comparisons. You probably want the second comparison to be made with the played_on field instead:
SELECT * FROM results WHERE "Hessle" = away_team AND played_on >= "2015-10-01";
In future questions, remember to provide a link to the course page you are working with.
Jessica Carey
690 PointsThanks Steven, after taking a break and coming back to the problem, I realized I completely left out The played_on column.
Paul Pepe
1,900 PointsPaul Pepe
1,900 PointsWHERE "Hessle" = away_team
should it not be
WHERE away_team = "Hessle"
?