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 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
228,991 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!!