SQL |
SELECT DISTINCT subtyp1, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CYCLING' and typ='COMPONENTS' and upper(subtyp1)<>'EMPTY' and style_id IN (1091,1093,1104,2815,6109,6392,6423,6448,6455,6480,6482,6489,6490,6512,6518,6530,6561,6562,6580,6591,6596,6633,6665,6683,6705,6728,6739,6752,6755,6763,6811,6812,6813,6818,6827,6833,6842,6845,6853,6885,6898,6904,6937,6987,7007,7041,7058,7078,7110,7133,7151,7160,7168,7172,7207,7252,7309,7310,7313,7314,7363,7364,7372,7431,7438,7467,7473,7481,7550,7583,7599,7609,7628,7640,7642,7649,7696,7699,7730,7743,7744,7773,7777,7800,7811,7816,7850,7861,7878,7882,7884,7889,8342,8582,8591,8600,8610,8620,8622,8633,8640,8663,8683,8688,8717,10274,10282,10283,10318,10379,10380,10394,10495,10536,10554,10599,10692,10694,10717,10940,11258,11415,11418,11429,11437,11448,11481,13888,13928,14015,14105,14188,14375,14531,14534,14573,14582,14705,14780,14877,14879,14880,14881,14882,14883,14922,14923,14945,14955,14974,14976,14997,15062,15134,15145,15154,15193,15207,15209,15246,15330,15331,15332,15346,15352,15380,15396,15444,15463,15464,15465,15468,15480,15482,15484,15494,15495,15500,15521,15587,15588,15597,15646,15668,15757,15758,15772,15788,15854,15879,15891,15937,15941,15942,15948,15949,15957,15960,15976,15977,16104,16110,16116,16182,16205,16225,16255,16264,16269,16270,16293,16294,16319,16369,16402,16449,16467,16643,16736,16744,16745,16772,17040,17042,17043,17055,17066,17084,17090,17091,17092,17093,17159,17160,17241,17242,17259,17266,17301,17302,17345,17346,17367,17369,17374,17380,17467,17499,17502,17515,17516,17532,17545,17567,17568,17569,17586,17635,17639,17681,17685,17691,17692,17753,17796,17797,17823,17827,17836,17879,17880,17964,17965,18064,18066,18067,18068,18072,18094,18095,18116,18159,18266,18292,18330,18332,18425,18432,18439,18440,18514,18515,18651,18696,18701,18702,18703,18704,18761,18946,18998,19201,19203,19285,19293,19294,19358,19479,19511,19513,19610,6960,7170,10547,17582)
GROUP BY subtyp1 |