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 SQL Basics Finding the Data You Want Filtering on More than One Condition

Cole Vance
Cole Vance
882 Points

What is my query missing? SELECT * FROM users WHERE last_name = "Hinkley" OR "Pettit";

I have tried multiple ways to write this query and have not been able to pass inspection.

2 Answers

The statement needs last_name for each value:

select * from users where last_name = "Hinlkey" OR last_name = "Pettit"
Cole Vance
Cole Vance
882 Points

Thank you for your help. I tried your suggestion and it didn't work. I double checked for silly mistakes and spelling etc. I'm thinking there's something wrong with the question.

I must have copied the wrong string, it had a typo on Hinkley, try this:

select * from users where last_name = "Hinkley" OR last_name = "Pettit"