0

So my issue is essentially if I have an order table with apples, oranges and pears.

How can I find which orders contained apples and oranges in that single order?

This is what I've been attempting but it's not working, it's just giving back all the orders that contain either apples or oranges


from `order` o
join order_item oi on oi.order_id = o.id
join product p on p.id = oi.product_id
join user u on u.id = o.user_id

where (p.name = 'apple' and p.name = 'orange')

Also sidenote, looking to get the names of the peoples who made these orders too.

John B
  • 43
  • 1
  • 7

0 Answers0