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(10860393,10860510,10860511,10860515,10861126,10858800,5654575,10859795,10865975,10865976,10865977,10855438,7198682,7198723,7198724,7198737,7198747,7198966,8554321,8554322,8905650,8905690,10425569,10615577,10426215,10426244,10611220,10611221,10611222,10609355,10609662,10612896,10613118,10610322,10610323,10610324,10610325,10610326,10610328,10610329,10610330,10610331,10613454,6673591,9911956,9911957,9911958,9911960,10118054,9912114,10118625,6672708,10416485,10419145,10419146,10419147,9167857,9167959,10883947,10883948,10883949,10884001,10884305,10884519,10883382,10885558,10885559,10885560,10885561,10885994,10647387,10507711,10507712,10507713,10507714,10507715,10413357,10414217,10414791,10414792,10414796,10415131) 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'