select distinct from dc_coupons where approved='1' and start_date_dt<'2014-10-31 12:33:38' and ( id in (2237,2238,2239,110718,111455,2614,119283,139958,139959,139973,139974,120904,120905,120906,144864,144898,144899,137943,137942,137921,137920,137770,137769,137768,137759,137758,144917,144919,144920,144921,144922,144900,144901,144902,144903,144852,144853,144854,144855,144856,144857,144858,144859,144860,144861,144862,144863,139223,139224,139225,139226,137228,137225,137222,137223,137221,137220,137219,137218,137217,137216,137215,137214,137213,137212,137211,137210,137209,137098,137097,138417,138419,136626,136625,136614,136613,144770,144771,144801,136475,144981,144980,144489,144448,144447,144446,136105,124550,124551,144411,144410,144409,144408,144407,144406,144404,144405,144403,144402,144327,144326,144325,144324,144309,144308,144307,144306,144305,144304,144303,144302,144289,144288,144287,144286,144199,144198,144197,144196,144194,144195,144165,143983,143982,135623,143981,143980,135566,135565,143922,143921,143920,143919,143918,143917,143727,143726,143725,143724,143692,143691,143690,143688,143689,135175,135174,135173,135171,135170,143611,143610,143609,143608,143605,143570,143569,143524,143498,138425,143427,143426,143290,143289,143288,143287,143286,143285,143274,143273,143272,143271,143270,143215,143214,143213,143194,143193,143159,143158,127123,143157,143156,143155,143153,143154,143152,143150,143151,143149,143142,143141,143140,143139,143136,143137,143138,143135,127183,127184,127185,127186,127187,127189,127190,127192,127193,143111,143110,143109,143108,134656,143107,143106,143105,143104,143103,143102,143101,143100,143099,134599,143056,143055,143054,138393,143053,143046,143045,143034,143032,143033,143031,143030,143029,143018,143017,143016,143015,143014,143013,143012,143011,143010,143009,143008,143007,143006,143005,143004,143003,143002,143001,143000,142998,142999,142996,142995,142994,142993,142992,142991,142990,142989,142968,142967,142966,142965,142929,142928,142927,142889,142888,142887,142886,142885,142884,142869,142868,142867,142835,142834,142828,142829,142827,138391,142824,142812,142811,142810,142809,142808,142807,142790,142789,142788,142781,142780,134183,134184,134185,142726,142725,142724,142514,142513,142512,142511,142510,142509,142508,142480,142479,142478,138388,142361,142360,142359,142358,142356,142355,142354,142353,142352,142351,139298,142350,142349,142348,142347,142346,142345,142344,128749,138379,142233,128765,128766,142232,142231,142230,142228,142229,142227,142226,142225,138436,142224,133506,133505,142223,142222,128806,142210,142209,128949,128950,128980,128981,128982,128983,128984,128985,128986,128987,128988,133434,133430,133429,133428,133427,133425,133426,142031,141918,141917,141916,141849,141850,141847,133134,133133,141746,138493,141736,141735,141733,141734,141732,141635,141634,141633,141618,141619,141617,141616,141615,141609,141608,132954,141607,141606,141567,141566,141565,141440,141439,141438,141437,141436,141435,141434,141433,141432,141412,141411,141410,141259,141250,141249,141248,141247,141246,141221,141220,141219,141218,138430,141093,138640,141026,141025,141024,141023,141021,141010,141009,141008,141006,141005,141004,141003,141002,141001,141000,132265,140999,132263,132262,132261,132260,140998,140997,140974,140973,140972,140971,140970,140969,140968,140967,140964,140963,140962,140960,140959,140958,140957,140956,132148,132147,140915,140914,140913,140912,140911,138377,132131,132130,132129,140838,140836,140835,140834,140833,132024,132023,140748,140747,140744,140743,140725,140724,140723,140722,140721,140720,140719,140718,140717,140716,140715,140714,140713,140712,140711,140709,140710,140708,140707,140706,140705,138845,138844,138411,140551,140550,140549,140473,140474,140472,140470,140471,140469,140468,140467,140466,140464,140463,142826,143687,143686,141260,140961,142791,142813,140837,140465,140832,141007,141022,143035,141737,143612,144488,142362,142997,141848,140068,140069,140070,140071,140072,140073,140074,140075,140076,140077,140078,140079,140098,140099,140100,140101,140102,140103,140150,140151,140152,140174,140185,140186,140187,140188,140189,140190,140192,140193,140194,140195,140196,140197,140198,140217,140218,140271,140272,140273,140274,140275,140276,140319,140320,140321,140322,140323,140324,140325,140326,140327,140328,140329,140330,140331,140332,140333,140334,140335,140336,140363,140396,140416,140417,140418) ) 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-10-31 12:33:38' and ' at line 1