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,52,54,60,141,378,795,798,799,803,810,814,826,1556,1557,1558,1559,1560,1825,1829,1830,1835,1836,1851,1865,1869,1882,1887,1888,1889,1893,1923,1924,1931,1934,1945,1951,1952,1956,1992,2003,2006,2362,2441,2442,2443,2444,2445,2446,2829,3258,3260,3309,3314,3324,3326,3343,3347,3352,3676,3690,3918,4048,4217,4388,4783,4957,4960,4964,4968,4991,4998,4999,5005,5019,5021,5022,5026,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,11529,11625,13901,13923,13949,14073,14133,14143,14425,14571,14601,14648,14722,14726,14728,14729,14730,14755,14828,14829,15055,15090,15199,15375,15426,15428,15431,15432,15433,15434,15446,15451,15452,15453,15454,15455,15502,15516,15517,15553,15555,15556,15637,15657,15658,15697,15704,15725,15726,15729,15734,15735,15736,15741,15742,15881,15883,15910,15911,15913,16119,16507,16508,16581,16583,16599,16603,16627,16628,16631,16724,16727,16729,16748,16750,16752,16782,16783,16784,16789,16861,16862,16863,16866,16868,16933,16936,16937,16939,16947,16958,16959,16961,16994,16997,16998,17002,17121,17180,17182,17193,17483,17485,17487,17489,17519,17520,17521,17609,17611,17647,17649,17650,17751,17752,17860,17975,18027,18028,18029,18035,18038,18039,18133,18134,18140,18145,18147,18148,18149,18150,18175,18185,18186,18189,18263,18276,18277,18298,18311,18312,18313,18314,18334,18417,18427,18428,18429,18511,18537,18538,18615,18616,18617,18656,18658,18822,18823,18824,18846,18898,18923,18926,18927,18929,19007,19008,19009,19011,19040,19042,19068,19075,19076,19103,19122,19126,19142,19143,19186,19193,19209,19231,19253,19254,19384,19475,19520,19613,19617,19732,19765,19810,19827,19834,19876,19878,19880,19885,19948,19949,19952,19953,20027,20028,20132,20202,20203,20204,20213,20269,20297,20325,19994)
GROUP BY subtyp2 |