SQL |
SELECT DISTINCT subtyp2, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='WOMENS' and subtyp1='Tops' and upper(subtyp2)<>'EMPTY' and style_id IN (337,338,1306,1314,1427,2957,2965,3127,3129,3132,3577,3609,3650,3651,3661,5326,5390,5391,5442,5535,5592,5610,5702,5745,5748,5751,5754,5755,5762,5771,6265,6316,6319,6322,8024,8069,8532,8533,8897,9568,9870,11278,11298,11313,14068,14362,14621,15225,15475,15685,15776,15899,16413,16425,16505,16598,16615,16616,16817,16838,16870,16881,16887,16928,16980,17020,17021,17023,17279,17625,17675,17743,17817,17848,17858,17912,17917,17939,17940,17942,17943,17945,17947,17950,18261,18341,18689,18717,18988,19129,19130,19152,19161,19211,19212,19248,19256,19333,19407,19423,19425,19767,19768,19829,19901,19902,19921,19956,19959,19960,19962,19969,19970,19973,19974,20082,20083,20084,20086,20144,20145,20147,20148,20155,20159,20174,20175,20176,20177,20181,20182,20183,20193,20197,20198,20219,20230,20231,20247,20290,20318,20319,20354,20355,20356,20357,20366,20367,20429,20431,20434,20459,20463,20464,20510,20511,20512,20513,20575,20612,20644,3487,20493)
GROUP BY subtyp2 |