Matching multiple rows in a MySQL database
This is usually done using conditional aggregation plus some applied logic:

select order_id,
   case max(case when product_type = 'A' then 1 else 0 end) +
        max(case when product_type = 'B' then 2 else 0 end)
      when 1 then 'A not B'
      when 2 then 'B not A'
      when 3 then 'A and B'
   end
from mytable
where product_type in ('A','B')
group by order_id