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 (605,607,608,609,610,615,618,621,622,623,624,636,637,638,1045,1047,1048,1049,1050,1051,1052,1208,1209,1210,1212,1213,3145,3146,3147,3148,3149,3156,3157,3158,3159,3160,3162,3165,3169,3176,3177,5757,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5793,5795,5797,5798,5799,5800,5801,5802,5803,5804,5808,5809,5810,5811,5812,5813,5814,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5827,5828,5830,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5865,5866,5870,5913,5914,5917,5918,5919,5920,5921,5922,5924,5925,5926,5927,5929,5930,7312,7313,7314,7430,7431,7432,7433,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8959,8960,8961,8962)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 72,24
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 = 40 OR cat_madre = 40) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id