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 (7599,120,121,122,9087,9086,9084,9083,9082,517,519,520,521,524,525,526,529,537,539,545,558,559,561,562,563,564,565,566,568,570,572,574,575,577,579,580,581,582,583,584,588,635,7375,9016,650,651,658,667,689,690,693,694,696,698,699,703,707,708,709,710,711,713,720,725,6125,7598,7597,1177,1178,7935,8095,7595,9022,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,3316,3318,3319,3409,3410,3411,3412,3413,3414,3492,3493,3494,3495,3496,3718,6273,3747,3748,3749,3783,3784,5680,5681,3790,3791,3792,3793,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3845,3846,3847,3849,3850,3852,3853,3854,3857,3862,4028,4029,4030,522,4292,4296,4298,4299,4305,4309,4312,4313,4314,4315,4316,4319,4328,4330,4332,4334,4336,4351,9021,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5450,5453,5455,5456,5459,5460,5461,5462,5489,5491,5625,5626,5634,5637,5638,5640,5641,5643,5682,5685,5688,5689,5715,5716,5717,5721,5722,5723,5724,5725,5726,5744,5758,5759,5760,6037,7816,6114,6116,6118,6119,6120,6121,6124,6274,6275,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6385,6392,6393,6394,6525,6847,6848,6849,6850,6851,6852,6855,6856,6858,6859,6860,6861,6862,6864,6865,6866,6867,6868,6869,6870,6873,6874,6876,6877,6878,6879,6880,6882,6883,6884,6886,6887,6888,6890,6899,6900,6901,6902,6903,6904,6905,6906,7004,7005,7006,7007,7008,7125,7126,7127,7128,7129,7131,7133,7134,7135,7136,7139,7140,7147,7149,7150,7151,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7183,7200,7201,7443,7302,7303,7304,7306,7322,7434,7435,7436,7437,7438,7439,7440,7441,7454,7455,7456,7457,7458,7459,7460,7461,7466,7469,7470,7471,7473,7476,7477,7478,7479,7480,7514,7623,7622,7621,7620,7619,7815,7565,7566,7600,7601,7602,7603,7604,7605,7606,7607,7608,7624,7625,7628,7629,7630,7631,7632,7633,7634,7635,7636,8103,7650,7648,7649,8217,7718,7747,7749,7750,8097,8096,7820,7817,7818,7819,7821,7824,7825,7847,7851,9018,7907,7908,7909,7910,7911,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8087,8088,8089,8147,9085,9020,8162,8161,8160,8159,8158,8570,8571,8572,8573,8575,8580,8582,8585,8586,8587,8588,8600,8601,8602,8603,8604,8605,8606,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8714,8941,8942,8943,8944,8945,9023,9024,9067,9068,9069,9070,9088,9089,9090,9091,9092)
GROUP BY pro_id
ORDER BY pro_stato ASC, pro_ordine DESC, pro_nome ASC
LIMIT 72,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 = 8 OR cat_madre = 8) AND pro_stato <= 7 AND cat_stato >= 1 AND sku_stato = 1
GROUP BY pro_id