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,141,374,376,391,788,791,793,804,825,856,1561,1562,1563,1565,1827,1831,1832,1840,1853,1854,1859,1863,1890,1892,1903,1904,1905,1906,1907,1909,1928,1930,1936,1944,1946,1947,1965,1975,1976,1996,1997,2007,2196,2214,2362,2696,2697,2829,3258,3260,3327,3331,3342,3346,3349,3351,3354,3412,3675,3685,3686,3687,3689,3692,3918,4048,4218,4279,4320,4387,4784,4785,4789,4798,4799,4954,4956,4962,4964,4970,4973,4979,4981,4989,4990,4992,4993,4995,5002,5004,5018,5027,5571,6988,7014,7109,8140,8150,8151,8191,8199,8200,8207,8218,8251,8269,8281,8318,8326,8328,8849,8854,8990,9130,9260,9264,9265,9266,9268,9906,10433,10434,10435,10926,11291,11475,11626,11627,13901,14072,14075,14076,14199,14205,14424,14540,14648,14727,14731,14732,14734,14737,14738,14817,14818,14846,15043,15196,15197,15248,15316,15376,15424,15425,15447,15448,15450,15503,15512,15514,15515,15518,15557,15558,15559,15560,15561,15635,15638,15641,15642,15643,15693,15694,15732,15739,15740,15743,15744,15745,15746,15747,15748,15749,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,16959,16962,16963,16993,16995,16996,17003,17032,17144,17348,17349,17391,17392,17484,17486,17488,17490,17610,17612,17646,17648,17820,17859,17975,18025,18037,18041,18042,18047,18132,18137,18141,18153,18154,18155,18156,18177,18278,18279,18281,18335,18336,18510,18539,18655,18657,18845,18924,18928,18930,18931,18935,19041,19057,19066,19067,19072,19073,19079,19082,19087,19105,19124,19125,19139,19185,19192,19207,19208,19230,19253,19254,19383,19473,19577,19612,1615,1616)
GROUP BY subtyp2 |