Databases SQL Basics Finding the Data You Want Filtering on More than One Condition

Devin Goodson
Devin Goodson
274 Points

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

Is this the right query?

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 50,936 Points

There are two solutions:

(1) Include last_name in both your conditions

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

(2) Use the IN operator

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