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

Ali Dabbir Khan
Ali Dabbir Khan
1,076 Points

What is the correct answer to the 2nd question?

I can't understand the mistake

Hi, I imagine you probably had issues with the end of your statement rather than the start considering you completed the first part.

The answer I got was:

SELECT * FROM users WHERE last_name = "Hinkley" OR last_name = "Pettit";

I imagine you put said something like last_name = "Hinkley" OR "Pettit" ?

Easy mistake to make

1 Answer

Steven Parker
Steven Parker
216,017 Points

Edward's guess seems likely to me also, but another solution would be to use the membership operator (IN):

SELECT * FROM users WHERE last_name IN ("Hinkley", "Pettit");

I might be getting ahead of things, I don't remember if that operator has been introduced yet at this point in the course.

And for future questions, or if Edward didn't guess the issue, please show your entire query here to allow a more specific answer.

Ali Dabbir Khan
Ali Dabbir Khan
1,076 Points

Yes, Edward is right. Thanks for the help!!