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,57,58,59,60,61,62,63,65,68,69,91,92,98,104,3290,147,149,152,155,156,158,160,223,224,225,226,227,492,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,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,3763,3764,3765,3766,3767,3768,4017,4018,4020,4021,4033,4061,4224,4552,4553,4561,4877,4878,4880,4881,4882,4885,4883,4884,5444,5466,5468,5472,5473,5474,5477,5480,5679,5891,5984,5998,6011,6018,6309,6535,6536,6537,6538,6539,6540,6541,6542,6543,6545,6558,6559,6560,6561,6562,6563,6564,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,7275,7298,7409,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,7950,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,8949,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,9036,9037,9038,9059,9060,9061,9065)
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 = 3 OR cat_madre = 3) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id