Question: I have two tables, `Customer` and `Sales`.

I have to select customer and salesperson in the query. I have combined both the tables with the primary key with customer ID .

I also have to filter the selected data where salesperson name is ‘ John’ and ‘jack ,

When I use

```
where salesperson = ‘John’ and ‘jack’

```

I am getting no results.

Please help me on how to get salesperson with names from jack and John .

Answer: 
You would use `in`:

```
where salesperson in ('John', 'Jack')

```

This is logically equivalent to:

```
where salesperson = 'John' or salesperson = 'Jack'

```

But `in` is simpler to write and less error-prone.

If you want *customers* that have been associated with both John and Jack, then you would combine this with aggregation:

```
select customerid
from sales
where salesperson in ('John', 'Jack')
group by customerid
having count(distinct salesperson) = 2;

```

That is, look for customers that have either saleperson. Aggregate and return only the customers that have had both.
AND is correct. Using OR as wouter suggests will output the result if 1 condition is matched so probably not what you want. Perhaps paste the full code here for better help. Have you tested just 1 name or OR just to ensure your query is working?