SQL |
SELECT DISTINCT subtyp1, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='MENS' and upper(subtyp1)<>'EMPTY' and style_id IN (12,53,358,374,391,421,435,683,684,685,733,756,784,788,793,800,804,825,856,918,947,1561,1562,1563,1565,1578,1585,1754,1827,1831,1840,1859,1890,1905,1907,1928,1936,1944,1946,1965,1975,1976,1997,2136,2137,2138,2141,2145,2148,2156,2162,2205,2221,2222,2223,2232,2235,2240,2362,2696,2697,2777,2782,2785,2786,2787,2829,2915,2922,2947,2961,3073,3088,3092,3095,3104,3246,3258,3259,3342,3346,3349,3351,3354,3406,3407,3408,3496,3515,3529,3599,3638,3641,3664,3666,3669,3675,3685,3686,3689,3692,4218,4279,4387,4788,4789,4798,4803,4918,4954,4956,4962,4970,4973,4983,4989,4990,4992,4993,4995,4997,5002,5003,5004,5027,5221,5249,5298,5301,5302,5304,5313,5316,5330,5339,5346,5358,5360,5362,5364,5425,5438,5449,5471,5479,5643,5644,5645,5662,5671,5695,5718,5719,5722,5731,5733,5744,5752,5753,5772,5777,5851,5864,5868,5874,5875,5876,5882,5884,5900,6176,6257,6502,7437,8030,8140,8150,8151,8166,8318,8326,8328,8639,8802,8820,8849,8854,8867,8908,8990,9045,9046,9058,9060,9069,9130,9145,9149,9260,9264,9266,9268,9377,9400,9427,9544,9575,9597,9626,9669,9718,9784,9898,10254,10286,10338,10434,10435,10608,10631,10687,10718,10729,10760,10788,10805,10817,10841,10874,11291,11293,11316,11361,11373,11557,11589,11626,13901,13959,13961,14072,14075,14076,14094,14101,14124,14127,14140,14255,14256,14281,14283,14287,14374,14382,14424,14619,14620,14648,14678,14732,14734,14738,14766,14782,14836,14842,14846,15105,15196,15213,15216,15316,15424,15425,15429,15447,15448,15503,15512,15518,15539,15557,15558,15560,15561,15572,15573,15638,15643,15732,15743,15744,15745,15746,15747,15748,15749,15844,15852,15912,15914,16013,16017,16021,16112,16120,16122,16148,16157,16169,16215,16216,16221,16248,16388,16510,16511,16512,16607,16655,16672,16725,16726,16768,16786,16787,16802,16804,16813,16832,16849,16858,16860,16865,16932,16934,16935,16949,16957,16959,16962,16963,16993,16995,16996,17003,17009,17032,17174,17199,17348,17349,17391,17484,17486,17488,17490,17680,17718,17719,17720,17820,17854,17859,17865,17902,17927,17934,17975,18042,18137,18138,18141,18154,18155,18177,18234,18235,18279,18282,18283,18295,18346,18423,18430,18466,18539,18540,18669,18774,18809,18931,18947,18951,18955,18974,18978,19041,19057,19069,19071,19079,19105,19124,19192,19200,19207,19230,19253,19254,19255,19279,19280,19309,19353,19354,19383,19473,19497,19577,19589,19612,19731,19750,19841,19875,19879,19884,19951,19954,19992,19998,20004,20006,20029,20049,20054,20078,20089,20090,20134,20156,20210,20212,20221,20222,20262,20295,20299,20328,20329,20330,20335,20371,20374,20376,20382,20403,20454,20497,20503,20567,20570,20597,20601,20690,20691,20692,20695,20696,20752,20767,20857,20882,20897,20971,20977,20992,21001,21031,21032,21035,21067,21078,21183,21190,21191,21192,21193,21210,21217,21218,21220,21228,21244,21245,21248,21252,21253,21254,21256,21262,21264,21265,21267,21275,21289,21291,21367,21372,21373,21374,21376,21377,21378,21381,21382,21385,21388,21392,21393,21394,21418,21420,21425,21426,21446,21450,21451,21477,21481,21482,21495,21497,21502,21534,21536,21557,21563,21569,21573,21586,21589,21607,21608,21613,21614,21616,21618,21621,21622,21623,21624,21625,21627,21629,21630,21713,21715,21741,21825,21826,21842,21843,21871,21872,21874,21879,21886,21920,21926,21945,21952,21958,21964,21988,22027,22110,22114,22119,22124,22156,22159,22160,22174,22227,22257,22287,22301,22317,22319,22320,22416,22464,22478,22565,22570,22636,22751,22752,22753,22754,23011,23013,23018,23085,23099,23277,23518,9355,19629)
GROUP BY subtyp1 |