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,374,391,788,793,800,804,825,856,1561,1562,1563,1565,1827,1831,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,4218,4279,4387,4788,4789,4798,4803,4954,4956,4962,4970,4973,4983,4989,4990,4992,4993,4995,4997,5002,5003,5004,5027,8140,8150,8151,8166,8318,8326,8328,8814,8854,9058,9069,9130,9260,9264,9266,9268,9784,10434,10435,11291,11293,11626,13901,14072,14075,14076,14424,14648,14732,14734,14737,14738,15196,15213,15216,15316,15424,15425,15429,15447,15448,15503,15512,15518,15557,15558,15560,15561,15638,15643,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,17646,17820,17859,17975,18042,18137,18138,18141,18153,18154,18155,18177,18279,18430,18539,18901,18931,19041,19057,19105,19124,19139,19192,19207,19230,19253,19254,19383,19473,19577,19612,19731,19750,19841,19875,19879,19884,19951,19954,19992,19998,20001,20004,20006,20049,20089,20090,20134,20210,20212,20503,20597,20601,20691,20752,20897,20971,20992,21001,21035,21393,21394,21607,21608,21614,21616,21618,21713,21825,21826,21842,21843,21871,21872,21874,21879,21886,21920,21926,22027,22257,22287,22464,22478,22570,22636,23011,23013,23018,23085,23099,23518)
GROUP BY subtyp2 |