SELECT product_id, stock_status, currency, brand_name, brand_company_id, product_name, product_image, style_number, price_min AS price, company_participates, MIN(price_min) AS min_price, MAX(price_max) AS max_price, MAX(has_ptp) AS max_has_ptp, MIN(is_dropship) AS is_dropshippable, INTERVAL(price,0,25,50,75,100,150,200,300,500,750,1000) AS price_range, ANY(x.id = 942 FOR x IN categories) AS has_category FROM product_stores_2 WHERE channel_id=1 AND brand_company_id=30 AND gender='unisex' AND price BETWEEN 50 AND 75 AND has_category=1 AND currency='USD' AND store_id=11501 GROUP BY product_id, currency ORDER BY stock_status desc, popularity_rank desc LIMIT 30 OPTION max_query_time=1