SQL |
SELECT DISTINCT subtyp1, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='WOMENS' and upper(subtyp1)<>'EMPTY' and style_id IN (54,60,337,338,378,420,425,431,433,437,439,442,783,795,798,799,803,804,810,826,918,950,953,1306,1319,1340,1341,1368,1383,1425,1427,1429,1556,1557,1558,1559,1560,1744,1753,1754,1758,1825,1829,1830,1835,1882,1888,1889,1893,1923,1924,1931,1951,1952,1956,1992,1998,2006,2136,2137,2141,2148,2156,2206,2224,2225,2226,2233,2234,2332,2362,2441,2442,2444,2445,2821,2829,2895,2965,2979,3000,3073,3075,3076,3080,3082,3086,3100,3201,3206,3215,3258,3259,3260,3293,3294,3302,3309,3314,3341,3347,3352,3379,3406,3408,3497,3529,3543,3549,3560,3561,3573,3577,3609,3622,3627,3635,3650,3651,3658,3676,3690,4217,4388,4888,4957,4960,4968,4991,4998,4999,5005,5019,5021,5022,5026,5031,5034,5242,5249,5298,5301,5302,5313,5316,5331,5339,5357,5359,5361,5363,5365,5383,5390,5391,5442,5461,5479,5506,5565,5637,5638,5662,5684,5696,5700,5709,5719,5722,5726,5728,5732,5733,5745,5748,5754,5755,5762,5771,5871,5887,5900,5920,6045,6047,6131,6132,6133,6134,6139,6240,6265,6275,6295,6502,7437,8152,8154,8183,8241,8242,8246,8266,8278,8320,8327,8329,8532,8533,8639,8679,8692,8723,8749,8790,8800,8816,8897,8908,8952,8961,8962,9023,9041,9053,9130,9147,9150,9261,9263,9266,9268,9400,9427,9428,9495,9568,9593,9721,9783,9858,9890,9898,9899,9904,9927,9931,10254,10279,10286,10338,10353,10397,10405,10420,10434,10435,10608,10614,10631,10687,10760,10841,10853,10874,10888,10934,10979,10981,10984,10993,11269,11290,11312,11313,11402,11404,11589,11625,13901,13909,13949,14067,14068,14069,14073,14125,14133,14177,14229,14244,14255,14425,14515,14612,14613,14635,14648,14678,14722,14728,14729,14730,14755,14766,14782,14785,14806,14828,14829,14842,14929,15055,15090,15198,15199,15213,15216,15251,15428,15431,15432,15433,15434,15446,15452,15453,15454,15455,15470,15516,15553,15555,15556,15637,15658,15683,15685,15726,15729,15735,15736,15741,15742,15750,15752,15760,15776,15828,15881,15883,15895,15913,16013,16015,16017,16020,16021,16087,16094,16097,16119,16126,16157,16216,16219,16221,16338,16400,16401,16442,16498,16500,16507,16581,16613,16628,16631,16658,16669,16724,16727,16729,16748,16750,16768,16782,16783,16784,16803,16805,16807,16808,16817,16829,16836,16861,16863,16866,16875,16879,16880,16881,16886,16887,16929,16933,16936,16939,16947,16948,16959,16960,16961,16994,16998,17002,17023,17121,17180,17182,17199,17483,17485,17487,17489,17519,17520,17521,17611,17621,17650,17715,17751,17752,17840,17857,17910,17939,17942,17975,18027,18029,18035,18133,18134,18140,18145,18148,18149,18185,18186,18187,18189,18227,18228,18234,18235,18236,18261,18272,18276,18277,18285,18312,18314,18334,18376,18379,18390,18395,18413,18417,18427,18429,18468,18469,18511,18535,18537,18538,18541,18615,18616,18617,18656,18669,18672,18773,18813,18822,18824,18846,18926,18929,18964,18988,19007,19008,19009,19011,19031,19040,19042,19069,19076,19081,19103,19122,19126,19142,19143,19152,19164,19193,19210,19211,19215,19231,19248,19253,19254,19297,19334,19353,19366,19379,19384,19475,19497,19613,19628,19732,19751,19810,19876,19878,19880,19885,19948,19949,19952,19972,19974,19994,19997,20002,20003,20005,20027,20028,20060,20081,20132,20150,20159,20202,20203,20204,20211,20213,20219,20223,20224,20286,20291,20293,20295,20301,20316,20337,20365,20368,20375,20377,20379,20383,20393,20396,20404,20431,20468,20491,20492,20493,20500,20501,20504,20505,20506,20507,20508,20514,20522,20524,20538,20569,20571,20577,20579,20597,20684,20687,20688,20691,20697,20698,20713,20768,20769,20770,20771,20857,20876,20898,20912,20914,20920,20958,20961,20962,20963,20964,20967,20972,20982,20993,21000,21002,21015,21032,21037,21039,21043,21050,21051,21057,21059,21066,21087,21090,21091,21112,21118,21121,21125,21128,21168,21169,21188,21189,21194,21197,21198,21199,21211,21214,21221,21222,21223,21224,21225,21229,21230,21232,21236,21237,21238,21242,21259,21262,21266,21269,21273,21276,21281,21285,21286,21314,21318,21319,21322,21324,21326,21355,21356,21361,21362,21364,21365,21367,21368,21390,21395,21396,21400,21401,21402,21404,21405,21406,21407,21408,21410,21424,21427,21429,21430,21431,21432,21435,21436,21437,21438,21439,21440,21441,21443,21471,21483,21484,21485,21486,21489,21491,21492,21494,21512,21515,21520,21523,21524,21525,21526,21527,21528,21529,21541,21543,21546,21547,21548,21549,21576,21592,21605,21606,21609,21610,21615,21617,21619,21714,21715,21741,21815,21823,21824,21827,21842,21843,21873,21876,21878,21880,21883,21921,21922,21928,21929,21931,21932,21934,21947,21948,21949,21950,21951,21996,22028,22093,22094,22108,22137,22138,22142,22154,22155,22218,22258,22288,22292,22293,22423,22465,22469,22477,22571,22637,22648,23081,23082,23083,23084,19629)
GROUP BY subtyp1 |