SELECT pro_id, pro_nome, pro_ordine, pro_stato, MIN(sku_vendita) AS min, MAX(sku_vendita) as MAX, (sku_listino - sku_vendita) AS diff , url_seo
FROM catalogo_prodotti
LEFT JOIN catalogo_sku ON pro_id = sku_prodotto
LEFT JOIN catalogo_categorie ON pro_categoria = cat_id
LEFT JOIN pagine_url ON pro_id = url_rif
WHERE pro_id IN (202,205,1505,1506,1507,1525,1526,1527,1528,1529,1530,1531,1532,1533,1535,1540,1539,1541,1543,1536,1538,1551,1552,1553,1554,1555,1572,1573,1581,1582,1583,1584,1585,1721,1722,1899,1902,1903,1904,1906,1907,1908,1911,2512,2513,2514,2516,3733,3872,3873,3874,3875,4062,4063,4064,8982,5406,5407,5408,5410,5411,5412,5413,5415,5416,5501,5502,5504,6265,6266,6267,6269,6270,6283,7119,7263,7250,7325,7508,1542,1537,1557,1534,7510,7512,7529,8033,7701,7776,7799,1504,7800,7801,7802,7803,8056,8057,8058,8111,8113,8114,8152,8153,8182,8212,8213,8375,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 36,12
SELECT pro_id AS proid
FROM catalogo_prodotti
LEFT JOIN catalogo_sku ON pro_id = sku_prodotto
LEFT JOIN catalogo_categorie ON pro_categoria = cat_id
LEFT JOIN pagine_url ON pro_id = url_rif
WHERE (cat_id = 9 OR cat_madre = 9) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id