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 (1093,1104,2819,6372,6423,6448,6455,6480,6482,6489,6490,6561,6562,6591,6596,6659,6665,6755,6763,6782,6786,6811,6812,6818,6819,6841,6845,6853,6904,6937,6987,7007,7078,7110,7133,7151,7168,7170,7172,7190,7201,7236,7252,7287,7309,7310,7356,7372,7431,7438,7467,7473,7481,7550,7599,7628,7630,7640,7641,7642,7644,7649,7730,7743,7744,7751,7777,7784,7800,7811,7816,7847,7878,7883,7884,7887,7889,8342,8582,8590,8600,8601,8610,8618,8620,8622,8640,8642,8643,8663,8671,8683,8688,8703,10260,10261,10274,10282,10325,10379,10394,10495,10536,10692,10694,10717,10940,11258,11415,11418,11429,11436,11437,11438,11488,13928,13950,14015,14105,14188,14262,14375,14534,14582,14705,14773,14779,14879,14880,14882,14883,14922,14955,14976,14997,15134,15145,15154,15246,15330,15332,15346,15352,15463,15465,15468,15494,15495,15500,15521,15588,15597,15646,15757,15758,15788,15854,15891,15937,15941,15942,15948,15949,15957,15975,15976,15977,15996,16003,16104,16110,16255,16269,16293,16319,16374,16402,16403,16467,16643,16735,16744,16745,16772,17039,17040,17042,17043,17055,17084,17092,17159,17160,17241,17242,17266,17301,17302,17345,17367,17374,17380,17499,17516,17567,17568,17569,17586,17635,17639,17681,17685,17775,17796,17797,17823,17836,17879,17964,17965,17993,18072,18094,18159,18266,18292,18332,18432,18439,18440,18514,18696,18702,18703,18704,18761,18762,18835,18998,19285,19293,19358,19479,19654,19678,19706,19713,19714,19790,19849,19977,19980,20069,20123,20142,20170,20236,20238,20242,20549,20559,20580,20662,20670,20673,20709,20712,20716,20732,20763,20778,20789,20845,20849,20852,20885,20888,20903,21472,22051,22052,22053,22054,22055,22056,22057,22058,22059,22063,22487,22488,22499,6960,10547,17582)
GROUP BY subtyp1 |