SQL |
SELECT DISTINCT subtyp1, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CYCLING' and typ='ACCESSORIES' and upper(subtyp1)<>'EMPTY' and style_id IN (1049,1066,1076,1085,1137,1236,1275,1276,2051,2140,2142,2159,2735,2817,2822,3263,3267,3357,5794,5795,5796,5801,5802,5805,5806,5836,5859,5888,5890,5895,5909,5915,5916,5917,6394,6417,6427,6438,6441,6447,6457,6525,6587,6653,6716,6764,6770,6772,6852,6862,7024,7026,7051,7092,7094,7266,7306,7347,7396,7417,7465,7592,7593,7607,7608,7610,7667,7732,7734,7740,7750,7786,7817,7827,7830,7854,8701,8739,8741,9958,9997,10217,10257,10263,10271,10289,10292,10344,10355,10382,10386,10387,10391,10407,10426,10430,10467,10468,10472,10484,10503,10504,10509,10511,10512,10514,10552,10589,10590,10593,10606,10623,10627,10665,10666,10670,10691,10723,10724,10739,10956,10958,10960,10962,10965,10967,10968,10970,10973,11419,11439,11452,11482,11512,11528,11548,11558,11583,11609,11613,11618,13893,13894,14135,14160,14161,14496,14536,14685,14687,14741,14768,14770,14771,14823,14841,14936,14993,14999,15001,15004,15034,15052,15064,15068,15115,15183,15184,15191,15202,15234,15252,15294,15295,15307,15308,15318,15351,15362,15364,15371,15381,15382,15488,15492,15583,15676,15702,15754,15778,15900,15904,15917,15932,15954,16075,16080,16115,16117,16118,16180,16181,16237,16291,16310,16396,16460,16490,16491,16770,17052,17060,17061,17062,17083,17148,17153,17238,17330,17331,17341,17342,17388,17395,17396,17479,17512,17536,17551,17553,17636,17654,17661,17684,17733,17736,17737,17755,17771,17777,17804,17822,17875,17876,17877,17977,17978,18019,18058,18167,18220,18256,18326,18327,18501,18552,18681,18755,18797,18839,19112,19175,19204,19235,19246,19247,19291,19293,19316,19317,19368,19369,19372,19477,19480,19514,19568,19569,19635,19649,19659,19660,19661,19663,19664,19666,19667,19670,19728,19844,19869,19937,19938,19939,19940,19941,19942,19978,20035,20101,20102,20126,20135,20139,20168,2163,7377)
GROUP BY subtyp1 |