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 (53,59,374,391,788,793,804,825,856,1561,1562,1563,1565,1827,1831,1832,1840,1859,1890,1905,1906,1907,1909,1928,1936,1944,1946,1947,1965,1975,1976,1997,2362,2696,2697,2829,3258,3259,3260,3342,3346,3349,3351,3354,3675,3685,3686,3689,3692,3918,4218,4279,4387,4788,4789,4798,4799,4803,4954,4956,4962,4970,4973,4989,4990,4992,4993,4995,5002,5004,5027,7014,8140,8150,8151,8166,8218,8318,8326,8328,8814,8854,9058,9069,9130,9260,9264,9266,9268,9784,10433,10434,10435,11291,11293,11626,13901,14072,14075,14076,14424,14648,14727,14732,14734,14737,14738,15196,15197,15213,15216,15316,15376,15424,15425,15429,15447,15448,15450,15503,15512,15514,15518,15557,15558,15560,15561,15638,15641,15642,15643,15696,15732,15743,15744,15745,15746,15747,15748,15749,15912,15914,16120,16148,16510,16511,16512,16725,16726,16787,16858,16860,16865,16867,16932,16934,16935,16957,16959,16962,16963,16993,16995,16996,17003,17032,17348,17349,17391,17484,17486,17488,17490,17610,17612,17646,17820,17859,17975,18025,18041,18042,18047,18132,18137,18138,18141,18153,18154,18155,18177,18190,18279,18336,18430,18498,18510,18539,18901,18924,18931,18935,19041,19057,19073,19082,19105,19124,19139,19192,19207,19230,19253,19254,19383,19473,19577,19612,19731,19750,19841,19875,19879,19881,19884,19951,19954,19992,19998,20001,20004,20006,20049,20089,20090,20134,20210,20212,20268,20296,20503,20597,20601,20603,20691,20752,20897,20971,20992,21001,21035,21038,21041,21393,21394,21607,21608,21614,21616,21618,21713,21819,21825,21842,21843,21871,21872,21874,21879,21886,21920,21926,22027,22257,22287,22464,22478,22570,22636,800,1615,1616,1918,4983)
GROUP BY subtyp2 |