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 (114,115,117,118,119,132,134,138,142,7639,1168,1175,1187,2050,2462,3711,5442,5495,5614,5618,5678,5848,6670,6671,6935,7535,7589,7590,8100,8256,8257,8258,8259,8260,8370,8371,8372,8373,8374,8376,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8983,9062)
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 = 18 AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id