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 (517,519,520,521,522,524,525,526,529,537,539,545,558,559,561,562,563,564,565,566,568,570,572,574,575,577,579,580,581,582,583,584,588,5680,5685,3792,3793,3831,5450,5453,5455,5456,5489,5491,5681,5682,5715,5716,5717,6382,6383,6385,6847,6848,6849,6850,6851,6852,6855,6856,6858,6859,6860,6861,6862,6870,6873,6874,6876,6877,6878,6879,6880,6882,6883,6884,6886,6887,6888,6890,7147,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7815,7816,7817,7818,7819,7820,7821,7851)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 48,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 = 36 AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id