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(11014766,11014767,10939983,8569814,8569830,8569831,8569832,8569833,8569834,8569835,8569836,8569837,10940514,8569875,8066916,8066938,7066037,7066041,8067504,7066542,10437539,8067952,8067953,8067954,8067955,8067968,8067969,8067970,8067971,8067999,8068003,8068004,8068005,8068018,8068019,8068020,8068021,8068022,8068023,8068024,7075140,11013873,11013874,11013875,8068087,8068088,8068089,8068109,8068110,8068111,8068112,10961906,8068113,10961916,10961917,7067273,7067274,7067275,8068173,8068174,8068175,8068176,8068212,8068213,8068214,8068215,8068216,8068267,8068284,8068306,8068335,8068336,8068337,8068338,8068339,8068361,8068362,11014182,11014183,11014184,8068429,8068449,8068452,8068471,8068477,8068478,8068480,8068486,8068487,8068488,8068489,8068493,8068494,8068495,8068496,8068509,8068510,8068511,8068512,8068513,8068514,8068559,8068560,8068561,8068562,8068563,8068564,8068565,8068598,8068603,8068605,8068612,8068659,8068662,8068667,8068668,8068680,7067794,8068689,8068695,8068706,8068712,8068713,8068720,8068729,8068730,8068731,8068732,8068733,8068735,8068748,8068753,8068761,8068762,10972790,7072154,7072155,7072156,7072285,11012172,10973188,8065903,8065904,8066218,8066255,8066256,8066268,8066269,8066270,8066286,8066287,8066288,8066310,8066311,8066318,8066345,8066346,8066380,8066400,8066459,8066460,8066461,8066462,8066463,8066464,8066473,8066474,8066482,8066483,8066491,8066498,8066499,8066500,8066501,8066507,8066520,8066521,8066522,8066523,8066524,8066525,8066526,8066527,8066528,8066558,8066565,8066575,8066577,8066593,8066594,8066595,8066630,8066637,8066638,8066661,8066662,8066684,8066692,8066694,8066695,8066696,8066697,8066698,8066713,8066714,8066719,8066720,8066758,8066774,8066775,8066776,8066777,8066778,8066789,8066790,8066800,8066803,8066804,8066820,8066838,8066850,8066851,8066852,8066853,8066866,8066867,8066868,8066869,8066887,8066911,10942785,7071625,7071655,10985438,7071763,7071866,7068963,7068982,7068983,7069001,7069002,7069003,7069029,7069030,7069054,7069072,7069076,10940804,10969876,10969877,10969878,10969879,10969880,10969881,10969882,10969883,10969884,10969885,10969886,10969887,10969888,10969889,10969890,10969891,10969892,7069289,10996236,10996237,10996238,10970580,10970581,10996701,10941854,10941856,10941857,10941858,10970919,10970920,10970921,10941873,10941894,10941915,10971011,7070460,10971151,10997169,7070622,10918485,10923615,10918651,10918652,10618154,10918763,10919204,10919205,10919206,10994537,10968643,10919977,10919978,10919979,8071199,8071200,10619835,10621985,10622011,10622014,10992708,10992709,10992710,10992711,10622055,10622060,10622071,10992739,10992740,10622115,10617119,10992780,10992983,10918000,10993173,10993198,10928060,10980261,10923228,10617746,10923268,10993425,10993426,10993427,10993428,10993429,10918282,10993430,10918283,10993431,10993432,10993433,11006474,10923396,8570084,8570085,10620186,10620187,10620188,10620195,10620196,10620197,10620198,10620199,10620200,10620201,10620207,10620208,10620307,10620381,10620382,10620384,10620385,10620386,10620387,10620414,11004260,10930740,10930766,10991525,10926755,10621294,10621310,10621323,10621341,10621345,10621346,10621347,10621348,10621352,10621353,10621354,10621355,10621375,10621381,10621382,10979047,10621400,10621401,10621402,10621403,10621404,10621405,10621422,10621428,10621429,10621436,10621445,10621446,10621447,10621453,10621456,10621461,10621465,10621529,10621572,10621595,10621601,10621615,10992275,10992276,10992277,10621620,10621631,10621632,10621637,10621639,10621641,10621649,10621655,10621668,10621672,10621675,10621717,10621724,10621732,10953433,10992441,10621958,10611180,10611245,10562908,10562909,10614777,10614795,10614796,10614797,10614798,10614849,10611908,10611909,10611910,10611911,10611912,10611913,10611914,10611915,10611916,10611917,10611926,10611927,10611928,10611929,10611930,10611931,10611932,10611933,10611934,10611935,10611936,9171619,10609984,10612987,10612988,10612989,10613058,10613066,10613149,7058739,8863102,7058843,10610390,10613455,8863320,8863334,8863391,8863406,8863414,8863415,8863416,8863441,10613612,8863475,8863476,9172955,8863477,8863478,8863479,8863480,8863481,8863491,8863492,8863501,8863512,8863522,8863523,8863529,8863559,8863560,8863561,8863593,8863594,8863601,8863610,8863621,8863625,10610811,7055907,7055908,10513712,10513713,9170181,7056823,2809391,2809392,2809393,2809396,2809397,2809400,10419242,10419271,10418317,10418319,10418322,10418329,10419385,8918237,10419543,10419556,10419562,10419563,9176675,10419796,10419797,10416943,10416944,10416945,10416043,9161151,7055438,4971590,10463315,10463316,6666975,6666989,10469726,10469727,10469728,10469729,4972058,4972059,4972060,4972061,4972062,8916871,10469803,10469804,10469805,10469806,4972106,4972107,4972108,4972109,4972110,4972111,4972112,4972125,4972158,4972160,4972169,4972170,4972171,4972194,4972198,4972202,4972203,4972205,4972208,4972239,10467965,4972255,10468038,10468045,10468063,10468082,8917203,4972468,10468210,10468211,10468212,8917442,10462397,10462398,10470666,6668181,10169495,10169496,10169497,10169527,10169528,10169532,10169533,10169545,10169546,10169547,10169548,10169560,10169566,10169567,10169576,10169584,10169585,10169586,10169587,10169588,10169589,10169602,10169608,10169613,10169642,10169653,10628152,10169701,10169706,10169733,10169745,10169746,10169747,10169757,10169760,10169761,10169807,10169835,10169838,10169862,10169863,10169864,10169865,10169866,10164873,10169881,10169882,10169917,10169939,10169958,10169959,10164965,10164966,10164967,10164968,10164969,10164970,10164971,10164972,10164973,10164974,10164975,10169987,10170027,10170028,10170243,10170325,10165467,10165468,10165469,10165470,10165471,10165472,10165473,10165474,10165475,10165476,10170651,10170657,10170898,10166071,10166072,10166073,10166074,10166075,10166076,10166077,10166078,10166079,10166080,10629559,10166081,10166082,10166083,10166084,10171090,10629580,10168504,10168505,10168529,10168530,10168531,10632016,10168546,10168547,10168561,10168562,10632040,10168563,10632041,10632042,10168564,10168565,10632043,10632044,10632045,10632046,10168582,10168583,10168584,10168585,10168590,10168591,10168592,10168666,10168679,10168680,10168681,10168682,10168683,10168684,10168690,10168701,10168702,10168704,10168705,10168706,10168707,10168708,10168709,10168753,10168754,10168755,10168756,10168757,10168758,10168759,10168760,10168761,10168762,10168763,10168764,10168765,10168766,10168810,10168826,10168851,10168852,10168853,10168867,10168879,10168902,10168903,10168904,10168905,10168906,10168907,10168920,10168921,10168922,10627415,10168945,10168946,10168947,10168972,10168973,10168985,10169006,10169007,10169018,10169024,10169046,10169047,10169048,10169117,10169118,10169127,10169128,10169129,10169130,10169131,10169132,10169174,10169175,10169176,10169177,10169178,10169184,10169185,10169195,10169196,10169197,10169198,10169237,10169238,10169239,10169244,10169245,10169246,10169247,10169264,10169265,10169276,10169277,10169278,10169279,10627790,10627821,10627822,10627823,10627824,10627825,10627826,10169349,10627827,10169350,10627828,10169351,10627829,10627830,10169412,10169451,10169475,10169476,10169479,10630050,10166646,10166709,10166816,10166824,10161924,10161928,10167015,10167022,10167047,10167145,10167146,10167197,10162247,10162260,10167278,10630853,10626145,10162678,10162679,10162680,10162752,10162753,10162754,10162755,10631236,10631237,10162766,10631456,10168228,10168229,10168230,10168231,10168232,10168233,10168234,10168235,10168301,10168302,10168311,10168320,10168353,10571380,10568570,10568571,10568572,10568573,10571717,10571718,10571719,10571720,10571721,10575111,10575112,10575113,10572254,10575784,10575785,10575786,10575787,10575982,10575983,10576094,10576095,10525324,10523760,10523767,10523780,10523781,10523782,10523783,10523841,10524359,10524360,10524417,10524494,10524537,10524538,10524563,10524564,10524565,10524566,10524567,10524568,10524569,10524570,10524571,10524572,10524573,10524574,10524575,10524576,10524577,10524599,10522614,10522615,10524620,10524621,10524622,10524623,10524624,10524625,10524626,10524627,10524679,10524685,10524719,10524781,10524786,10520839,10520840,10422253,10420864,10420865,10420866,10420867,10420868,10420869,10420870,10420871,10420872,10424053,10424058,10421092,10421096,10421097,10421100,10423103,10421104,10421109,10421118,10422121,10421123,10421134,10421143,10479209,10479611,10479612,10479636,10479637,10479638,10479639,10479640,10479641,10479642,10479643,10479644,10479645,10479646,10479647,10479648,10479649,10479650,10479651,10479652,10479653,10479754,10479755,10479811,10479812,10479813,10479814,10479815,10479816,10479817,10479818,10479819,10479820,10479821,10478048,10478176,10476444,10472536) 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'