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 (141,378,795,798,799,803,810,814,826,1556,1557,1558,1559,1560,1825,1829,1830,1835,1836,1851,1865,1869,1887,1888,1889,1893,1923,1924,1931,1951,1952,1956,1992,1998,2003,2006,2362,2441,2442,2443,2444,2445,2446,2829,3258,3260,3309,3314,3324,3326,3338,3343,3347,3352,3676,3690,3918,4048,4217,4316,4388,4783,4957,4960,4963,4964,4968,4980,4991,4998,4999,5005,5019,5021,5022,5034,5908,8152,8154,8183,8202,8203,8241,8242,8246,8262,8266,8272,8278,8280,8283,8320,8327,8329,8790,8952,9130,9261,9263,9265,9266,9268,9783,10433,10434,10435,10934,11288,11290,11477,11529,11625,13901,13923,13949,14073,14074,14133,14143,14200,14425,14571,14601,14648,14722,14726,14728,14729,14730,14755,14794,14828,14829,14830,15055,15090,15199,15375,15426,15431,15432,15433,15434,15446,15451,15452,15453,15454,15455,15502,15516,15517,15553,15555,15556,15637,15657,15658,15695,15697,15704,15725,15726,15735,15736,15741,15742,15881,15883,15910,15913,16119,16384,16507,16508,16581,16583,16599,16603,16627,16628,16631,16690,16724,16727,16729,16748,16750,16751,16752,16782,16784,16861,16862,16863,16866,16868,16933,16936,16937,16939,16947,16958,16959,16961,16994,16997,16998,17002,17180,17193,17483,17485,17487,17489,17519,17520,17521,17609,17611,17647,17649,17650,17751,17752,17860,17975,18027,18035,18036,18038,18133,18134,18185,18186,18276,18277,18311,18313,18314,18333,18334,18417,18427,18428,18429,18511,18537,18538,18615,18616,18617,18656,18658,18822,18823,18824,18846,18913,18923,18926,18927,18929,19011,19040,19042,19068,19074,19075,19076,19080,19081,19103,19122,19126,19138,19142,19143,19186,19193,19209,19231,19253,19254,19384,19475,19519,19520,19613,19617)
GROUP BY subtyp2 |