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 (635,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301,2302,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2477,2478,2479,2480,3409,3492,3493,3494,3495,3496,3832,3833,5625,5626,5634,5637,5638,5640,5641,5643,6370,6371,6372,6375,7434,7435,7436,7437,7438,7439,7440,7441,7443,7619,7604,7605,7606,7607,7608,7620,7621,7622,7623,7624,7625,7628,7629,7630,7631,7632,7633,7634,7635,7636,7910,7911,8087,8088,8089)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 0,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 = 41 AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id