select distinct from dc_coupons where approved='1' and start_date_dt<'2014-09-02 05:36:58' and ( id in (5392,139673,139674,139675,139676,139672,139916,139937,139938,139939,139967,139970,139971,120318,120393,138120,138121,138122,138119,138118,138117,138116,138111,138110,138109,138108,138107,138106,138769,144865,144866,144867,144868,144869,137943,137942,137919,137917,144639,144640,144641,144642,144643,144649,144650,144651,144652,144653,144654,144655,144656,144657,144658,144659,144666,144670,144671,144672,144673,144674,137816,137813,137811,137803,137802,137800,137765,137764,137762,137763,144684,144687,137637,137636,137605,137514,137513,137512,137510,137511,137508,137509,137502,137500,137501,137499,144818,144829,144830,144836,144837,144838,144570,144571,137259,137250,137248,137206,137205,137204,137203,137202,144595,144596,144597,144598,144599,144600,144601,144602,123422,136607,136605,136606,144703,144763,144764,144794,136453,144979,144978,144977,144967,144517,144516,144496,144467,144466,144465,144464,144457,144456,144441,144438,144439,144437,136107,136106,144377,144376,144356,144344,144343,144342,144341,144323,144322,144321,144320,144319,144318,144220,144205,144204,144203,144202,144201,144200,144169,144164,144162,144161,144160,144159,144158,144157,144133,144132,144131,144130,144129,144128,144127,144126,144125,144124,144123,144122,144120,144121,144119,125118,144118,144117,144116,144115,144114,144113,144112,144111,144109,144110,144108,144107,144106,144105,144096,144095,144094,144009,144007,144006,143997,143996,143995,143986,143985,143984,143954,135564,135563,135562,143913,143912,143911,143910,143909,143908,143907,143905,143871,143870,125830,143808,143807,143806,143805,143804,143803,143802,143801,143800,143799,143798,143797,143796,143782,143762,143761,143753,143752,143684,143683,143682,143663,143661,143660,143659,143658,143657,143656,143655,143654,143634,143633,143632,143631,143630,143629,143627,143628,143626,139448,143606,143595,143594,143593,143592,143591,143590,143568,143567,143566,143565,143564,143559,143556,143555,143554,143553,143552,143550,143549,143538,143537,143523,143521,143520,143476,143475,143474,143429,143428,143394,143393,143392,143390,143391,143389,143388,143327,143325,143326,143324,143322,143323,143269,143268,143267,143266,143265,143232,143231,143230,143228,143216,143198,143197,143196,143195,143177,143178,143176,143175,143174,143173,143172,143171,143170,143169,143166,143167,143168,143162,143163,143164,143165,143161,143160,143148,143147,143146,143145,143144,143143,143128,143127,143126,143125,143123,143124,143121,143122,143120,143119,143118,143078,143077,143076,143075,142964,142963,142962,142961,142960,142959,142958,142957,142956,142955,142954,142953,142952,142951,142950,142949,142935,138457,138458,138459,138460,133928,134397,134398,134399,142907,142906,142905,142904,142903,142902,142901,142900,142899,142898,142897,142869,142868,142867,142825,142814,142770,142769,142768,142767,142766,142765,142764,142763,142762,142761,142760,139671,142735,142734,142733,142732,142695,142694,142692,142693,142691,142690,142689,142688,142687,142686,142677,142665,142664,142663,142662,142660,142659,142658,142657,142656,142655,142654,142653,142601,142600,142599,142598,142597,142596,142578,142577,133931,133932,133933,133930,133929,133927,133920,133919,133909,133903,133902,133901,142518,142516,142515,138456,142492,142491,142369,142368,142363,142357,142356,142355,142354,142353,142352,142351,142350,142349,142348,142347,142346,142345,142344,142339,142338,142337,142336,142335,142331,142330,142329,142328,142327,142326,142325,142324,133537,133536,142289,142288,142287,142286,142285,142284,142283,142265,142263,142264,142262,142261,142260,128701,128702,128703,128704,128705,128712,128713,128728,128729,128733,128734,128735,128736,128737,128738,128739,133506,133505,128829,128830,128848,128850,128851,142191,142190,142189,142188,128941,128942,142133,142132,142131,142124,142123,142122,142121,142090,142089,142088,142087,142086,129066,129067,129068,129069,129090,129091,142055,142054,142052,142053,142051,142050,142049,133309,133308,133307,133306,133305,133304,141904,141903,141902,141840,141839,133114,141761,141760,141759,141758,141757,141755,141756,134400,141682,141681,141680,141679,141626,141625,141624,141623,141622,141621,141589,141587,141588,141586,141582,141581,141580,141579,141578,141577,141576,141574,141573,141572,132901,132900,141542,141541,141540,141514,141513,141512,141511,141510,141509,141431,141430,141429,141309,141308,141307,141300,141269,141268,132501,132409,132408,132407,132406,132405,132404,132403,141136,141135,141134,141133,141132,141131,141128,141127,141126,141125,141124,141123,141121,141120,141119,141118,141117,141116,141091,141090,141088,141089,141072,141040,141039,141038,141037,132253,132252,132235,132234,132233,132231,132228,132227,132226,132225,132223,132222,132221,140915,140914,140913,140912,140911,140882,140881,140880,140879,140878,140877,140876,132120,132119,140850,140849,140848,140846,140842,140841,140840,140839,140817,140816,140815,140814,140813,131985,140792,140776,140775,140769,140748,140747,140746,140745,140742,140740,140741,140739,140738,140737,140736,140685,140663,140661,140662,140660,140659,140645,140644,138845,138844,140612,140611,140610,140609,140608,140574,140572,140571,140546,140544,140543,140530,140529,140528,140527,140526,141122,143522,141092,141036,144163,143551,142519,140847,143906,143607,143229,143685,144458,140545,144090,143662,141841,144440,142517,140573,141115,140058,140064,140065,140156,140159,140162,140181,140182,140183,140184,140231,140232,140295,140312,140319,140320,140321,140322,140323,140324,140325,140326,140327,140328,140329,140330,140331,140332,140333,140334,140335,140336,140337,140355,140356,140358,140359,140360,140361,140373,140374,140390,140391,140392,140393,140421,140422,140423,140433) ) order by creation_date_dt desc limit 0, 10 |1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from dc_coupons where approved='1' and start_date_dt<'2014-09-02 05:36:58' and ' at line 1