select distinct from dc_coupons where approved='1' and start_date_dt<'2012-05-25 06:47:49' and ( id in (2237,2238,2239,110718,112237,111455,2614,119283,140010,140011,140012,139958,139959,139973,139974,138324,138323,139736,138307,138772,138773,138268,138267,138265,138266,138263,138264,138262,138261,138260,138259,138258,138257,138255,138244,138243,138242,138241,120904,120905,120906,120907,120911,138791,139711,137943,137942,137927,137926,137921,137920,139710,121412,121482,121483,121484,121486,137881,137880,137878,137879,138471,138472,138473,138474,137770,137769,137768,137759,137758,139735,137700,137699,137698,137697,138639,137532,137530,137529,137527,137528,137446,137445,137444,137391,137390,139734,139223,139224,139225,139226,137228,137225,137222,137223,137224,137221,137220,137219,137218,137217,137216,137215,137214,122463,122464,138470,137213,137212,137211,137210,137209,137160,137159,137156,137154,137155,137153,137152,139321,137110,139322,137108,137109,137098,137097,138410,139074,139075,136989,136988,136987,136986,139281,139290,139293,139294,122966,122967,122968,122969,122970,122971,136891,136889,136890,136888,136799,123215,136798,136797,136796,139125,136716,136715,136711,136710,136709,136706,136705,136704,136703,138417,138418,138419,138420,136626,136625,136614,136613,136612,139712,136536,138692,138693,136478,136477,136476,136475,136474,136473,136469,136468,136467,136466,136465,136464,136461,136460,136459,136458,136456,136389,136383,139732,138789,138790,124034,124035,136324,136323,139731,124166,124167,136137,136138,136140,136132,136130,138889,136129,136128,136127,136119,136118,138890,136117,136115,136105,124550,124551,136052,138888,138341,139511,139718,124961,124962,124963,125000,135810,139715,139716,135639,135640,135638,135637,135636,135635,135634,135633,135632,135631,135630,135629,135628,135627,135626,135625,135624,135623,135622,135621,135620,135566,135565,139717,139323,135491,139291,139292,135489,135490,135483,138339,135376,138340,139730,135301,135300,139714,135291,135288,135287,135286,135285,139729,138532,138533,138534,138535,138563,139289,135225,135222,135223,135224,135208,135207,135206,135175,135174,135173,135171,135170,135168,126327,126328,126329,126330,138892,135053,135051,138425,134943,134942,134941,134939,134895,139122,139123,134893,134892,134891,139124,134880,134886,134887,138980,134802,134801,134800,134798,134797,134796,138971,138972,134703,134704,134705,138397,134709,134702,127123,134664,138395,138396,127183,127184,127185,127186,127187,127189,127190,127192,127193,134663,134650,134651,134652,134653,134654,134655,134656,134660,134661,134662,138428,139728,134599,134598,134575,134576,134577,138392,138394,138393,134535,139783,139784,134481,134472,134473,134474,139065,134385,134380,134371,134370,134369,127618,127619,127620,138801,138802,138808,138391,134266,134265,134220,134221,134219,127819,139727,134183,134184,134185,134128,134126,134127,134125,134124,134121,127926,127927,127936,127937,127938,127939,127940,127941,139762,138975,138976,138480,138390,133752,133753,133754,133755,133738,138426,138427,128407,128409,139308,133711,138911,133714,133713,133712,133707,133706,133705,139191,138389,138388,139192,139193,139194,139195,139196,138424,139300,139299,139298,139297,139296,139295,133589,133588,133573,138386,138387,128654,128655,128659,128660,128661,128662,128663,128664,128665,128666,128667,128668,138385,128749,128758,138379,138380,128764,128765,128766,138421,138422,138423,139726,138436,133506,133505,128806,139253,139246,138487,138486,139733,128948,128949,128950,139168,139725,139165,139220,139201,139200,139199,128980,128981,128982,128983,128984,128985,128986,128987,128988,139197,139198,138485,138484,139172,139173,139174,139175,139171,139170,139169,138483,138482,138481,139167,139166,139164,139163,139162,133434,133430,133429,133428,133427,133425,133426,133419,133415,133414,133413,133407,133406,133405,139713,138384,138383,139135,139134,139251,133292,139252,139133,139131,139132,139129,139130,139741,139128,139127,139126,133246,133199,133198,139763,133197,133178,133177,133134,133133,133095,133093,133092,133090,133091,133066,139081,139084,139082,139083,138492,138493,133065,133064,133063,139724,129612,139069,139068,139066,139067,134368,139062,139063,139064,139060,134381,134379,139059,138382,138429,138491,138490,138488,138489,132969,139073,132963,132962,132961,132959,132960,132958,132957,132956,132955,132954,132953,132952,132951,132950,132949,138792,138793,138771,132935,132931,132930,132929,139723,138840,132870,132869,132867,132866,132860,132859,132858,132857,132856,138838,138839,132855,132854,132811,132810,132809,138378,132703,132702,139722,139721,139740,138978,138977,130110,130111,139080,138974,138973,132586,132587,132585,138965,138964,132567,132566,132565,132564,132558,132557,132556,132555,138935,132442,132441,132440,132439,132438,138430,132410,132381,132380,132379,132378,132377,132376,132375,130443,138640,132265,132264,132263,132262,132261,132260,138412,132207,132206,132205,132204,130637,139739,138896,138895,138475,132148,138476,132147,138477,138894,138893,139720,139719,138891,138381,138377,132131,132130,132129,138478,138479,132071,132070,132069,132068,132067,132066,132024,132023,131934,131933,131932,131931,131930,131929,131928,131927,131920,131921,131919,131918,131917,131916,131915,131914,131913,131901,131900,131852,131851,131850,131839,131835,131830,131828,131826,138847,131825,131823,131822,131821,131820,131818,131817,139738,139737,138845,138846,138844,138411,138843,138842,138841,131759,131758,138966,131719,131718,131717,131713,131711,133585,138955,138811,138810,138809,138775,138774) ) 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<'2012-05-25 06:47:49' and ' at line 1