position----desc---SELECT DISTINCT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, IF(at_back_label.value_id > 0, at_back_label.value, at_back_label_default.value) AS `back_label`, (SELECT value FROM `catalog_product_entity_int` camp WHERE `camp`.`attribute_id` =(SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code` = 'campaign_product') AND `camp`.`entity_id`=`e`.`entity_id`) AS `campaign`, (SELECT value FROM `catalog_product_entity_int` acc WHERE `acc`.`attribute_id` =(SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code` = 'is_accessories') AND `acc`.`entity_id`=`e`.`entity_id`) AS `accessories` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=10 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '479' INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_product_index_eav` AS `disc_p_idx` ON disc_p_idx.entity_id = e.entity_id AND disc_p_idx.attribute_id = '245' AND disc_p_idx.store_id = 10 AND disc_p_idx.value in ('258') LEFT JOIN `catalog_product_entity_varchar` AS `at_back_label_default` ON (`at_back_label_default`.`entity_id` = `e`.`entity_id`) AND (`at_back_label_default`.`attribute_id` = '175') AND `at_back_label_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_varchar` AS `at_back_label` ON (`at_back_label`.`entity_id` = `e`.`entity_id`) AND (`at_back_label`.`attribute_id` = '175') AND (`at_back_label`.`store_id` = 10) ORDER BY FIELD(campaign, 1) DESC, FIELD(accessories, 1) ASC
SELECT FILTERS
186

All Blacks