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,374,376,788,791,793,804,825,856,1305,1561,1562,1563,1565,1827,1831,1832,1853,1854,1859,1863,1890,1892,1903,1904,1905,1906,1907,1909,1928,1930,1936,1944,1946,1947,1976,1996,2007,2196,2214,2362,2696,2697,2829,2865,3258,3260,3327,3331,3342,3346,3349,3350,3351,3354,3412,3675,3685,3686,3687,3689,3692,3918,4048,4138,4218,4279,4320,4321,4362,4387,4784,4785,4788,4789,4798,4799,4954,4956,4962,4964,4970,4973,4979,4981,4989,4990,4993,4995,5002,5004,5018,5027,6988,7014,7109,8140,8150,8151,8166,8191,8195,8199,8200,8207,8251,8269,8281,8282,8318,8326,8328,8849,8854,8884,8990,9029,9042,9066,9067,9130,9260,9264,9265,9266,9268,9746,9784,9906,9910,10241,10433,10434,10435,10926,10931,10935,11291,11292,11293,11303,11475,11476,11626,11627,13901,14072,14075,14142,14199,14203,14205,14424,14540,14648,14727,14731,14732,14734,14737,14738,14764,14817,14818,14846,15043,15196,15197,15248,15376,15424,15425,15436,15447,15450,15503,15512,15514,15515,15518,15557,15558,15559,15560,15561,15567,15635,15638,15641,15642,15643,15693,15694,15732,15739,15740,15743,15744,15745,15746,15747,15748,15749,15875,15908,15912,15914,16001,16120,16148,16162,16383,16510,16511,16512,16580,16582,16599,16602,16626,16635,16689,16725,16726,16728,16780,16781,16786,16787,16858,16859,16860,16865,16867,16932,16934,16935,16957,16962,16963,16992,16993,16995,16996,17003,17144,17184,17348,17349,17391,17392,17484,17486,17488,17490,17610,17612,17646,17648,17859,17975,18025,18026,18037,18041,18042,18043,18047,18132,18137,18141,18154,18156,18157,18177,18190,18278,18281,18335,18336,18498,18510,18539,18655,18657,18677,18748,18945,1615,1616)
GROUP BY subtyp2 |