[Solved] SQL Query – Need some assistance with a query [closed]


One way of doing this is to filter your select by using a subselect in the where clause. I did this really fast just to demonstrate:

select * from manufacturer m 
inner join manufacturer_has_product mhp
    on m.manufacturer_id = m.manufacturer_id
inner join product p
    on mhp.product_id = p.product_id
where m.manufacturer_id in (
    select m.manufacturer_id
    from manufacturer m
    inner join manufacturer_has_product mhp
        on m.manufacturer_id = m.manufacturer_id
    inner join product p
        on mhp.product_id = p.product_id
    inner join productType_has_product pthp
        on pt.product_product_id = p.product_id
    inner join productType pt
        on pt.productType_type_id = pt.type_id
    group by m.manufacturer_id
    having count(pt.type_id) > 1
    )

5

solved SQL Query – Need some assistance with a query [closed]