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 (3876,3877,3878,3879,3880,3883,3886,3887,3888,3889,3890,3892,3893,3894,3896,3897,3898,3899,3900,3901,3902,3906,3908,3909,3910,3913,3914,3915,3920,3921,3925)
GROUP BY pro_id
ORDER BY sku_vendita DESC, pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 144,48
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 = 164 AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id