SQL |
SELECT DISTINCT subtyp2, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='MENS' and subtyp1='Accessories' and upper(subtyp2)<>'EMPTY' and style_id IN (3,684,685,688,696,734,756,2777,2778,2781,2787,2790,3397,3398,3408,3797,4093,4291,4848,5215,5225,5233,5235,5236,5242,5249,5264,5269,5270,5273,5291,5294,5298,5299,5300,5302,5304,5313,5314,5316,5324,5339,5405,5449,5451,5479,5583,5662,5694,5697,5718,6064,8799,8868,9027,9063,9399,9400,9426,9427,9478,9518,9575,9837,10140,13959,13960,14099,14101,14124,14140,14765,14766,14832,14833,14834,14835,14836,14837,14838,14839,14840,14963,15851,15852,15946,15994,16121,16122,16169,16170,16338,16353,16354,16365,16388,16389,16520,16521,16584,16679,16680,16681,16768,16769,17399,17400,1292,1294,2798,5279,5287,8912,9028,9416)
GROUP BY subtyp2 |