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(8630625,8630626,8630629,8630630,8630631,8630632,8630633,8630634,8630636,8630638,8630639,8630640,8630641,8630642,8630643,8630644,8630645,8630646,8630647,8630648,8630649,8630650,8630651,8630652,8630653,8630654,8630655,8630656,8630657,8067941,7067586,10866922,10866923,10866924,10866925,10866926,10866927,10866928,10866929,8910465,8627238,8627239,8627240,8627241,8627249,8627250,8627253,8627284,8627285,8627286,8627287,8627291,8627292,8627310,8627312,8627313,10619875,8634738,8634739,8634740,8634741,8634742,8634743,8634744,8634745,8634746,8634747,8634754,8634755,8634756,8634757,8634758,10419802,10419803,10419804,10419805,10419806,10419807,10419808,10419809,10419810) 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'