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 (130,960,1049,1066,1076,1085,1234,1236,1275,1276,2051,2140,2142,2159,2735,2817,2822,5794,5795,5796,5801,5802,5805,5806,5836,5859,5890,5895,5916,5917,6388,6394,6417,6438,6441,6447,6457,6525,6526,6586,6587,6625,6770,6862,7024,7051,7094,7205,7233,7266,7306,7347,7417,7465,7532,7592,7593,7607,7608,7610,7667,7732,7734,7740,7750,7786,7817,7827,7830,7854,8736,8739,8741,9124,9958,9997,10144,10263,10355,10386,10391,10430,10467,10468,10472,10484,10503,10504,10506,10509,10511,10512,10514,10589,10590,10593,10624,10627,10634,10670,10698,10711,10723,10731,10739,10918,10956,10960,10961,10967,11419,11452,11482,11512,11528,11548,11558,11583,11604,11609,11618,13894,14135,14150,14160,14496,14536,14654,14685,14687,14741,14768,14841,14936,14993,14999,15052,15064,15115,15183,15186,15202,15234,15307,15308,15351,15364,15437,15488,15676,15702,15754,15778,15900,15901,15917,15932,15954,16080,16115,16117,16118,16180,16291,16310,16364,16396,16460,16491,16770,16987,17052,17060,17061,17062,17083,17148,17153,17238,17294,17330,17331,17341,17342,17388,17395,17479,17512,17536,17551,17553,17654,17661,17733,17736,17737,17771,17777,17822,17845,17875,17876,17877,17977,17978,18058,18167,18256,18326,18501,18552,18736,18838,18839,18939,19175,19204,19235,19246,19291,19293,19368,19372,19455,19477,19514,19569,19622,19635,19659,19660,19664,19666,19670,19869,19938,19940,19941,19942,19978,20035,20101,20135,20139,20387,20389,20406,20518,20650,20651,20652,20654,20655,20656,20657,20658,20660,20669,20678,20679,20772,20792,20802,20835,20907,20909,20910,20970,21009,21010,21238,21459,21460,21462,21598,21599,21601,21686,21687,21705,21715,21716,21718,21719,21720,21737,21738,21814,21959,21960,21961,21962,22063,22152,22499,7377)
GROUP BY subtyp1 |