You don’t need to use the product report. You can directly use the quotation table and add Philips with the model number. Of course, if there is no word Philips in the model number, you can use in (subquery to find out the Philips model number)
SELECT tt.`duler` FROM (
SELECT SUM(t.`type`) AS `count`, t.`duler` FROM ( # duler 是经销商
SELECT q.* FROM quotation q
LEFT JOIN product p
ON q.`type` = q.`type` # type 是型号
WHERE q.`type` LIKE '飞利浦%'
) t
GROUP BY t.`duler`
) tt
WHERE tt.`count` = 6
You don’t need to use the product report. You can directly use the quotation table and add Philips with the model number. Of course, if there is no word Philips in the model number, you can use in (subquery to find out the Philips model number)
Isn’t it just a join table query?>?