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 (1054,1053,1056,1057,1060,1063,1081,1083,1084,1110,1136,2168,3294,3295,3296,4542,5697,6038,6039,6040,6754,6755,7010,7011,7012,7013,7014,7305,7332,7333,7538,8194,8195,8196,8197,8198,8199,8200,8201,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599)
GROUP BY pro_id
ORDER BY diff DESC, 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 = 54 OR cat_madre = 54) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id