QUERY: SELECT p.products_id, p.products_model, p.label_ids, p.main_category, p.products_ean, p.products_fsk18, p.products_quantity, p.products_quantity_min, p.products_quantity_step, p.products_price, p.products_price_small_opt, p.products_price_opt, p.products_purchase_price, p.small_opt_purchase_price, p.count_small_opt_purchase_price, p.count_opt_purchase_price, p.opt_purchase_price, p.postavshik, p.suplier_catalog_id, p.postavshik_comment, p.name_catalog_id, p.products_tax_class_id, p.products_image, p.products_vpe, p.products_vpe_status, p.products_vpe_value, p.products_currency, p.products_page_url, p.video, p.show_video, pd.products_short_description, p.rev_total, p.rev_rating, pd.products_name, p.products_ordered, pd.products_short_description, s.status, IF(s.status, s.specials_new_products_price, 0) as specials_new_products_price, m.manufacturers_name, m.manufacturers_id FROM products AS p LEFT JOIN products_description AS pd ON (p.products_id = pd.products_id) LEFT JOIN manufacturers AS m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN specials AS s on p.products_id = s.products_id LEFT JOIN products_to_categories as p2c2 ON (p2c2.products_id=p.products_id) LEFT JOIN categories as c ON (c.categories_id=p2c2.categories_id) WHERE p.products_status = 1 AND c.categories_status = 1 AND pd.language_id = '1' AND p.products_id IN(11001855,11015176,8622254,8561418,7075916,7075919,11040605,10103864,11012581,11012582,11012583,7065144,8837177,7073755,11010629,3927753,10943260,10957380,10957381,3923509,11032817,11032818,10920249,11044815,8611974,11005914,11005915,11005916,10928015,10928024,11032556,10916064,8567921,10122070,9916131,9916132,6670162,6670163,6670164,6670165,9190247,9190249,9211584,9211586,9211603,9211632,4974350,4974351,10125962,9201932,2809414,10116500,8865196,6679628,8551265,10894663,7001394,10891263,10912208,10178335,10178460,10178461,10178466,10178467,10588538,10588539,10588540,10588541,10588542,10588543,10545588,10520041,10520042,10520043,10520044,10520045,10520046,10520047,10520048,10520049,10520050,10520051,10520052,10520053,10546116,10538738,10508311,10508312,10493566) GROUP BY p.products_id ORDER BY CASE WHEN products_price = 0 THEN 99999999 WHEN products_price > 0 THEN products_price END asc ,p.products_specials desc
ERROR: Unknown column 'p.products_specials' in 'order clause'