SELECT subtyp_2, web_url
FROM tb_web_taxonomy
WHERE dept='CLOTHING AND FOOTWEAR' and typ='MEN''S' and subtyp_1='ACCESSORIES' and subtyp_2>'' and subtyp_3='EMPTY' and subtyp_2<>'EMPTY'
ORDER BY sort_position
query
RESULTSET
query
ITEMCOUNT
SUBTYP2
1
1
GLOVES & MITTENS
2
10
SUMMER HATS
3
12
WINTER HATS & BALACLAVAS
CACHED
false
EXECUTIONTIME
23
SQL
SELECT DISTINCT subtyp2, count(distinct style_id) as itemCount
FROM web_all_products
WHERE dept='CLOTHING AND FOOTWEAR' and typ='MENS' and subtyp1='Accessories' and upper(subtyp2)<>'EMPTY' and style_id IN (5221,5236,5249,5269,5279,5299,5300,5301,5302,5309,5313,5316,14099,14101,16121,16122,16125,17194,18192,19497,20261,20262,20267)
GROUP BY subtyp2