Question: Hi I need help on a sql query. The result must match values for a single column across the rows. Here is an example. I need to find out store(s) that must have all of these items for sale: Books, Stationery, and Toys.

```
Store Items
----- --------
AA     PERFUMES
AA     TOYS
BB     STATIONERY
BB     BOOKS
BB     TOYS

```

In the example above, "BB" is the only store that matches all of our criteria and hence the result expected from the query.

I tried query with AND operator (`select store from storeitem where items = 'books' and items ='toys' and items='stationery';`) and it did not work as it expects all values in the same row and with in operator (`select store from storeitem where items in ('books','stationery','toys');`) , this doesn't follow must match all values criteria.
Need your help on this.

Answer: 
```
select store
from (
  select distinct store, items
  from your_table
  where items in ('books','stationery','toys')
)
group by store
having count(0) = 3

```
If I correctly understand your question, you needed that query:

Select store from storeitem where store in (select store from storeitem where items = 'books') AND store in (select store from storeitem where items ='toys') AND store in (select store from storeitem where items='stationairy')