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(8630649,8631041,8631064,8631255,8631257,8631259,8631261,8631263,8631265,8631267,8631269,8631271,8631273,8631876,8631881,8631885,10871528,10871535,10871541,8629599,8837591,8630188,8630192,8630194,8630195,8630196,8630204,8630406,10861117,8630529,8911035,8627716,8627718,10973056,8628041,8628082,8628094,5654577,5654578,5654579,5654660,8837157,8837361,8837363,8626757,8626760,8626764,8627017,10857694,8627125,8627132,8627141,8627146,8627150,8627154,8627159,8627163,8627167,8627172,8627176,8627184,8627188,8627192,8627197,8627202,8627206,8627217,8627515,10855311,10855312,10863546,10863547,10863548,10863552,8624935,8624960,8624973,8624978,10863648,10863651,10863652,10863653,10863679,10863680,8625045,8625056,7198725,8625225,10856865,10856866,10856867,10856868,10856869,10856877,10856878,10856879,10856896,10856897,10856904,8626281,8626282,8626283,8626284,8626285,8626286,8626287,8626288,8626289,8626290,8626291,8626292,8626293,8626294,8626295,8626296,8626297,8626298,8626299,8626300,8626301,8626302,8626308,8626454,8626455,8626456,8626457,8626458,8626459,8626460,8626461,8626462,8626463,8626464,8626476,8626490,8626494,3233417,3233418,3233419,3233426,10623064,3233953,3924433,3924434,11046938,11046939,11046967,11047033,11047054,11047059,8907461,11047096,11047097,11047148,11047169,10619864,10619866,8634606,8634607,10927504,10927505,10966658,8634696,8634697,8634706,8634748,8634802,8634814,8634831,3922814,10993170,10993204,10993292,10850424,10620186,10620195,10620196,10620197,10620201,10615363,8633097,8633214,8633230,8633241,10615896,10991606,10616045,8540541,8540542,8540568,8540604,8611003,8904348,8634112,8611466,8611467,10953442,3232241,3232265,3232275,3232294,3232295,3232296,3232297,3232298,3232316,3232328,3232346,10611969,9211924,9211925,9211936,10612939,10613127,9172490,8852331,9188957,8567513,10117525,8849324,8849325,10126033,10118293,9912458,10516142,8850517,9179212,6672864,6672890,6672892,6673010,6673162,8848796,8848797,6673288,6673297,6673308,10417079,10417080,10417081,10417085,10417087,10417088,10417148,10417149,10417150,10417151,8569274,8569275,8569277,8569279,8569280,9207303,8847514,8848064,8848065,8848066,8848067,8848068,8848069,10883585,10883586,10883588,10883622,10883623,10903808,10903809,10903810,10903812,10903813,10889231,10632012,10627707,10627708,10627715,10627716,10627717,10627718,10627719,10627720,10627721,10627722,10627723,10626127,10626128,10626142,10643469,10598862,10598863,10598864,10602722,10590996,10528100,10522612,10522613,10422994,10423001,10423007,10411778,10411779,10411780,10411781,10411782,10411790,10411807,10411808,10411811,10410491) 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'