SQL |
SELECT DISTINCT subtyp2, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='MENS' and subtyp1='Footwear' and upper(subtyp2)<>'EMPTY' and style_id IN (56,59,150,160,164,177,374,376,387,389,788,791,793,804,809,825,856,1561,1562,1563,1565,1827,1831,1853,1854,1859,1863,1904,1905,1928,1929,1936,1944,1946,1947,1953,1959,1965,1975,1976,1996,1997,2007,2196,2214,2362,2696,2697,2858,2863,2865,3258,3260,3327,3328,3331,3336,3342,3346,3349,3350,3351,3354,3410,3412,3675,3685,3686,3687,3689,3692,4048,4218,4276,4279,4319,4320,4321,4334,4362,4387,4784,4788,4789,4798,4799,4803,4954,4956,4964,4970,4971,4979,4981,4989,4990,4992,4993,4995,5002,5004,5018,5027,5281,5306,5390,8140,8145,8150,8151,8166,8185,8191,8195,8207,8209,8218,8251,8252,8259,8269,8281,8282,8318,8326,8328,8809,8849,8854,8884,8990,9029,9043,9047,9064,9066,9067,9069,9130,9259,9260,9264,9265,9266,9268,9524,9746,9784,9832,9906,9908,9910,10234,10241,10242,10246,10433,10434,10435,10922,10926,10931,10932,10935,11226,11228,11250,11291,11292,11293,11303,11305,11475,11476,11626,11627,11628,13924,14142,14199,14203,14205,14424,14540,14648,14727,14731,14732,14734,14737,14738,14764,14817,14818,14846,14847,15043,15089,15196,15248,15376,15424,15425,15429,15436,15447,15448,15450,15503,15512,15514,15518,15557,15558,15560,15561,15567,15638,15640,15643,15694,15696,15732,15733,15737,15739,15740,15743,15744,15745,15746,15747,15748,15749,15766,15792,15793,15875,15908,15909,15912,15914,16001,16002,16005,16120,16144,16148,16162,16228,16383,16580,16582,16599,16626,16689,16726,16728,16749,16780,16781,16786,16787,16860,17032,17144,17348,17349,17392,17484,17486,17488,17490,1615,1616,6988,7109)
GROUP BY subtyp2 |