Код: Выделить всё
SELECT
COUNT(*) AS no_skus,
pd_vendor AS brand,
(SELECT COUNT(DISTINCT(pd_model_code))
FROM product_data
WHERE pd_vendor = PD.pd_vendor ) AS unique_models
FROM product_data PD
GROUP BY pd_vendor
ORDER BY COUNT(*) DESC";
Подробнее здесь: https://stackoverflow.com/questions/341 ... gniters-ac