Could not successfully run query: 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 '%') OR (dealer_name LIKE '%TED'%')) LIMIT 1' at line 1

SELECT dealer_id FROM dealers_rvtrader where `condition`='N' and state='MN' and city='PAYNESVILLE' and ((dealer_name LIKE '%TED'%') OR (dealer_name LIKE '%TED'%')) LIMIT 1