SQL |
SELECT DISTINCT subtyp2, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='WOMENS' and subtyp1='Footwear' and upper(subtyp2)<>'EMPTY' and style_id IN (51,378,795,798,799,803,810,814,826,1556,1558,1559,1560,1825,1829,1830,1835,1836,1849,1851,1865,1869,1882,1887,1888,1889,1893,1923,1924,1926,1931,1942,1951,1952,1992,1994,2002,2003,2006,2195,2362,2441,2442,2443,2444,2445,2446,2829,3258,3260,3309,3314,3324,3326,3338,3343,3347,3352,3676,3690,3918,4048,4217,4316,4330,4388,4783,4957,4960,4963,4964,4968,4980,4991,4998,4999,5005,5019,5021,5022,5034,5908,8152,8154,8183,8202,8203,8210,8241,8242,8246,8262,8266,8272,8278,8279,8283,8320,8327,8329,8790,8952,9130,9261,9263,9265,9266,9268,9499,9783,9907,10433,10434,10435,10934,11288,11289,11290,11477,11529,11625,13901,13923,13949,14073,14133,14143,14200,14206,14425,14571,14601,14648,14722,14726,14728,14729,14730,14755,14794,14819,14828,15090,15198,15199,15249,15375,15426,15428,15431,15432,15433,15434,15446,15451,15452,15453,15454,15455,15502,15516,15517,15553,15556,15637,15657,15658,15695,15697,15704,15725,15726,15735,15881,15883,15910,15913,16119,16384,16507,16508,16581,16583,16599,16603,16627,16628,16631,16690,16724,16727,16729,16748,16750,16751,16782,16784,16861,16862,16863,16866,16868,16933,16937,16939,16947,16958,16961,16994,16997,16998,17002,17182,17193,17483,17485,17487,17489,17519,17520,17521,17609,17611,17647,17649,17650,17751,17752,17860,17975,18027,18029,18035,18036,18038,18133,18134,18150,18185,18186,18277,18311,18313,18314,18334,18417,18427,18428,18429,18499,18511,18537,18538,18615,18616,18617,18656,18658,18677,18913)
GROUP BY subtyp2 |