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,683,684,685,687,688,696,734,756,918,930,941,946,950,953,2217,2777,2781,2782,2787,2790,2791,3098,3379,3397,3406,3407,3408,3797,4291,4848,5215,5225,5233,5235,5236,5242,5269,5270,5273,5279,5291,5298,5299,5300,5304,5309,5324,5339,5405,5449,5451,5662,5694,5696,5697,5718,6062,6063,6064,8559,8560,8799,8802,8868,8911,9027,9063,9399,9400,9415,9427,9518,9575,9624,9626,9837,10140,10788,10803,10817,10855,10856,11588,11589,13959,13960,13961,14099,14101,14124,14677,14678,14766,14833,14835,14836,14837,14838,14839,14840,15574,15852,15945,15946,15994,16015,16021,16022,16121,16122,16125,16127,16157,16158,16161,16169,16170,16216,16217,16219,16338,16353,16354,16388,16389,16520,16768,16769,16949,17001,17624,17709,17710,17714,17718,17719,17720,17811,17923,17924,17928,17935,18188,18192,18226,18227,18228,18234,18235,18250,18282,18377,18380,18381,18423,18489,18494,18495,18496,18522,18533,18534,18535,18667,18669,18673,18674,18679,18740,18741,947,952,1294,8912,9028,10874,10875,10877)
GROUP BY subtyp2 |