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,190,194,195,196,200,208,209,210,7719,738,739,740,741,743,744,745,746,748,750,753,755,756,758,761,762,763,768,773,774,775,779,780,781,783,785,787,851,856,857,985,862,867,870,871,872,880,884,896,899,902,916,919,920,922,926,927,928,929,930,931,933,934,935,936,937,938,939,941,943,944,946,947,948,949,950,951,953,954,955,956,959,960,965,969,975,976,977,978,980,981,982,984,986,987,996,997,998,999,1000,1001,1002,1003,4376,4375,1005,1006,1007,1009,1010,1011,1012,4517,1014,1015,1016,1017,1018,1019,1020,1021,1023,1130,1131,1132,1133,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1716,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,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3717,3719,3734,3736,3758,3759,3760,3780,3781,3798,4512,4513,4514,4515,4516,4549,4560,4566,4567,4568,4569,4570,4571,4572,4573,4574,4872,4871,4870,4869,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,5160,5161,5163,5255,5256,5257,5258,5259,5260,5261,5262,5263,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,5496,5545,5546,5547,5548,5549,5644,5900,5904,5905,5906,5908,5910,5911,6027,917,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6386,6908,6909,6910,6911,6918,6919,6920,6921,6922,6924,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)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 24,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