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 (53,54,55,56,58,59,60,61,62,63,65,67,68,69,91,92,98,104,3290,147,149,150,152,155,156,158,160,223,224,225,226,227,492,494,495,496,497,10,4225,11,4228,1358,4226,1359,4227,1360,1361,4229,1416,1421,1422,1424,1426,1427,1428,1430,1431,1433,1434,1441,1444,1445,1446,1447,1449,1450,1453,1579,1580,2272,2273,2274,2275,2276,2277,2278,2484,2485,2486,2487,2488,2515,3292,3315,3416,3417,3419,3420,3422,3423,3424,3425,3426,3427,3428,3429,3434,3451,3452,3456,7320,3459,3460,3461,3465,3735,3737,3756,3764,3765,3766,3767,3768,4007,4017,4018,4020,4021,4022,4023,4033,4061,4224,4552,4553,4561,4877,4875,4878,4880,4881,4882,4885,4883,4884,5444,5466,5468,5472,5473,5474,5477,5480,5481,5622,5679,5891,5984,5998,6011,6018,6149,6309,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6557,6558,6559,6560,6561,6562,6563,6564,6566,6567,6568,6570,6571,6572,6573,6574,6575,6577,6578,6579,6581,6582,6583,6584,6614,6639,6640,6896,6897,7057,7058,7068,7069,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7086,7085,7087,7088,7089,7091,7092,7093,7094,7095,7116,7117,7122,7124,7275,7298,7409,7396,7395,7311,7321,7336,7351,7353,7357,7359,7360,7361,7363,7549,7550,7571,7617,8032,7892,7885,8138,8128,7884,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7702,7715,7742,7743,7744,7745,7757,7822,7998,8049,8050,8063,8064,8171,8172,8183,8191,8192,8240,8241,8313,8314,8315,8316,8317,8318,8319,8350,8351,8359,8360,8361,8362,8363,8397,8632,8633,8634,8635,8636,8637,8638,8639,8641,8642,8643)
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 = 3 OR cat_madre = 3) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id