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 (960,1049,1066,1076,1085,1137,1234,1236,1275,1276,2051,2140,2159,2699,2735,2817,2822,3267,5794,5795,5796,5801,5802,5805,5806,5836,5859,5890,5895,5909,5915,5916,5917,6388,6394,6417,6427,6438,6441,6447,6457,6525,6526,6586,6587,6716,6770,6852,7024,7051,7094,7233,7266,7306,7347,7417,7465,7532,7592,7593,7607,7608,7610,7622,7667,7721,7732,7734,7740,7750,7786,7817,7827,7830,7854,8701,8736,8739,8741,9124,9958,9997,10144,10257,10263,10344,10355,10382,10386,10387,10391,10407,10430,10467,10468,10472,10484,10503,10504,10506,10509,10511,10512,10514,10589,10590,10593,10624,10627,10634,10666,10670,10698,10711,10723,10731,10739,10918,10956,10960,10961,10967,11419,11452,11482,11512,11528,11548,11558,11583,11604,11609,11613,11618,13894,14135,14150,14160,14496,14536,14654,14685,14687,14741,14768,14770,14823,14841,14936,14993,14999,15001,15052,15064,15068,15115,15183,15184,15186,15202,15234,15252,15318,15351,15362,15364,15371,15382,15437,15488,15492,15676,15702,15754,15778,15900,15901,15904,15917,15932,15954,16068,16080,16115,16117,16118,16180,16291,16310,16364,16396,16460,16491,16770,16987,17052,17060,17061,17083,17148,17153,17238,17294,17330,17331,17341,17342,17388,17395,17396,17479,17512,17536,17551,17553,17654,17661,17684,17733,17736,17737,17777,17804,17822,17875,17876,17877,17977,17978,18058,18167,18256,18326,18501,18552,18736,18797,18838,18839,18939,19175,19204,19235,19246,19247,19291,19293,19317,19368,19455,19477,19480,19514,19569,19635,19649,19659,19660,19661,19662,19664,19666,19670,19869,19938,19939,19940,19941,19942,19978,20035,20101,20126,20135,20140,20168,20387,20389,20406,20518,20650,20651,20652,20653,20654,20655,20656,20657,20658,20659,20660,20669,20678,20679,20772,20792,20802,20835,20907,20926,20970,21238,21459,21461,21597,21598,21599,21600,21601,21686,21687,21705,21715,21716,21718,21719,21720,21737,21738,21814,21829,21959,21960,21961,21962,2163,7377)
GROUP BY subtyp1 |