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

Am I missing something?

Here is my code:

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

And this is the error I get when I submit it for this challenge:

"Expecting two rows, please check that you are checking for both names and they are correct."

I am using the OR keyword, selected all the columns from the correct table and have included both names in quotes.

Please let me know if I am missing something, thank you!

1 Answer

If you are going to use OR then you need to specify the field name in each condition of your WHERE clause.

I just solved it right as you posted the answer, thank you!