select distinct from dc_coupons where approved='1' and start_date_dt<'2012-05-25 07:17:12' and ( id in (119421,119422,139655,139656,140056,140057,139851,139850,139849,139848,139847,139846,139845,139844,139843,138236,138235,138234,139622,139825,139824,139621,139620,139619,139618,139617,137902,137901,137899,137900,139616,139615,139614,121480,121481,121482,121483,121484,121486,139613,139612,139611,139610,139609,139608,139607,139606,139605,139828,139604,139603,137347,139602,139839,139601,139823,139600,139599,139598,139597,139596,139838,139125,123345,139911,139837,136394,139822,135849,135848,135806,135805,135804,135802,135803,135801,135800,135799,135797,135798,135756,139910,135735,135736,135734,135726,135725,139821,135688,135687,135686,135665,135664,139827,134895,139122,139123,134893,134892,134891,139124,139836,134886,134887,139840,139842,127122,139815,139813,139814,139812,139841,139820,139366,139365,139364,134319,134177,134176,134118,134119,134120,134117,134116,134115,127936,127937,127938,127939,127940,127941,134080,134079,134076,134075,128334,133644,133527,133525,139819,139826,139211,139835,139131,139129,139130,139128,139127,139126,133109,133108,133107,133106,133105,133104,133103,133102,139818,139060,139059,139834,139817,130110,130111,139833,139832,132381,132380,132379,132378,132377,132376,132375,132173,132153,132152,132151,132150,132149,132050,132049,132048,139831,131963,131962,131961,131941,139830,133526,139829,139816) ) 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 07:17:12' and ' at line 1