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 (186,185,188,194,195,196,200,208,210,7719,738,739,740,741,742,743,744,745,746,748,750,755,758,761,762,779,780,781,783,787,985,871,872,920,927,931,944,953,959,960,965,986,987,996,997,998,999,1000,1001,1003,4376,4375,1005,1009,1010,1012,4517,1014,1015,1016,1017,1020,1023,1130,1131,1148,1150,1151,1152,1154,1158,1159,1160,1161,1162,2058,2059,2060,2061,2062,2063,2064,751,2575,2919,2920,2921,2922,2923,2924,2925,2926,2927,3799,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,3293,3311,3312,3673,3675,3676,3678,3679,3680,3682,3683,3684,3685,3686,3717,3719,3734,3736,3758,3760,3780,3781,3798,4512,4513,4514,4515,4516,4549,4560,4566,4567,4574,4872,4871,4870,4869,4855,4856,4857,4858,4860,4861,4862,4863,4864,4865,4866,4867,4868,5160,5161,5163,5255,5256,5257,5258,5259,5260,5261,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5302,5384,5381,5382,5383,5417,5418,5545,5546,5547,5548,5644,1157,5900,5904,5905,5906,5908,5910,5911,6027,917,6358,6361,6362,6363,6364,6365,6366,6367,6368,6386,6908,6910,6911,6918,6920,6921,6928,6929,6930,6932,6933,6934,7264,7265,7300,7425,7509,8120,7691,7692,7693,7725,7726,7727,7729,7730,7731,7732,7733,7734,8053,8148,8180,8181,8187,8188,8189,8190,8432,8431,8430,8429,8428,8427,8426,8425,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8640,8710,8711,8712,8713,8716,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8947,8948,9064)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 96,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 = 5 OR cat_madre = 5) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id