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,329,359,374,391,421,435,683,684,685,733,756,764,780,784,788,793,800,804,825,856,918,947,950,1561,1562,1563,1565,1578,1579,1580,1585,1753,1754,1827,1831,1840,1859,1890,1905,1906,1907,1909,1928,1936,1944,1946,1947,1965,1975,1976,1997,2124,2136,2137,2138,2141,2145,2148,2156,2162,2205,2221,2222,2223,2232,2235,2240,2362,2696,2697,2777,2782,2785,2786,2787,2821,2829,3073,3088,3092,3095,3104,3246,3258,3259,3260,3342,3346,3349,3351,3354,3379,3405,3406,3407,3408,3496,3497,3515,3521,3529,3543,3549,3573,3589,3599,3604,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,5242,5249,5269,5298,5301,5302,5304,5313,5316,5328,5330,5337,5346,5360,5362,5364,5405,5425,5433,5438,5449,5471,5479,5552,5644,5645,5652,5653,5662,5695,5696,5718,5719,5722,5731,5733,5752,5753,5772,5777,5851,5864,5868,5874,5875,5876,5882,5884,5900,6176,6257,6502,7437,7989,8011,8030,8140,8150,8151,8166,8318,8326,8328,8639,8802,8814,8820,8854,8867,8908,9022,9045,9046,9058,9060,9063,9069,9130,9145,9149,9260,9264,9266,9268,9377,9400,9427,9518,9575,9626,9718,9784,9849,9898,9915,10254,10286,10338,10434,10435,10608,10631,10687,10718,10729,10760,10788,10805,10817,10841,10874,10877,11291,11293,11316,11318,11557,11589,11592,11626,13901,13959,13961,14072,14075,14076,14101,14127,14140,14255,14256,14281,14282,14283,14374,14382,14424,14619,14620,14648,14678,14732,14734,14737,14738,14766,14782,14836,14842,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,15893,15912,15914,16013,16017,16020,16021,16112,16120,16122,16148,16157,16169,16215,16216,16219,16221,16248,16338,16353,16388,16418,16423,16510,16511,16512,16607,16655,16676,16725,16726,16768,16787,16802,16804,16832,16858,16860,16865,16867,16883,16932,16934,16935,16949,16957,16959,16962,16963,16993,16995,16996,17003,17009,17017,17032,17174,17199,17348,17349,17391,17484,17486,17488,17490,17610,17646,17709,17718,17719,17720,17820,17852,17854,17859,17865,17901,17902,17926,17927,17972,17975,18042,18137,18138,18141,18153,18154,18155,18177,18227,18228,18234,18235,18236,18279,18282,18283,18286,18295,18346,18377,18423,18430,18466,18535,18539,18540,18669,18672,18740,18774,18901,18931,18947,18951,18955,18978,19041,19057,19069,19105,19124,19139,19192,19200,19207,19230,19253,19254,19255,19279,19280,19309,19353,19354,19383,19473,19497,19577,19589,19612,19731,19750,19833,19841,19875,19879,19884,19951,19954,19992,19998,20001,20004,20006,20029,20049,20054,20062,20078,20089,20090,20134,20154,20156,20210,20212,20217,20221,20222,20261,20262,20295,20299,20317,20328,20329,20330,20335,20352,20371,20374,20376,20382,20403,20409,20417,20454,20483,20497,20503,20567,20568,20570,20597,20601,20691,20692,20695,20696,20752,20766,20767,20857,20897,20913,20971,20989,20992,21001,21031,21032,21035,21069,21075,21078,21080,21170,21173,21183,21190,21191,21192,21193,21210,21212,21216,21217,21218,21219,21220,21228,21244,21245,21247,21248,21252,21256,21262,21264,21265,21267,21289,21291,21367,21374,21375,21376,21377,21378,21381,21382,21385,21388,21392,21393,21394,21411,21412,21418,21420,21421,21425,21426,21446,21449,21450,21451,21481,21482,21495,21497,21498,21500,21502,21503,21534,21551,21554,21557,21560,21561,21563,21569,21573,21586,21589,21607,21608,21613,21614,21616,21618,21621,21622,21623,21624,21625,21627,21629,21630,21713,21715,21741,21825,21826,21841,21842,21843,21871,21872,21874,21879,21886,21920,21926,21945,21946,21952,21953,21958,21964,21988,21989,22027,22050,22110,22113,22114,22119,22124,22153,22156,22159,22160,22174,22175,22219,22227,22257,22287,22301,22317,22318,22319,22320,22416,22464,22478,22565,22570,22636,22749,22751,22752,22753,22754,22756,23011,23013,23018,23085,23099,23277,23518,9355,10875,11356,19629)
GROUP BY subtyp1 |