SQL Error: 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 'AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (' at line 1 at /home/httpd/vhosts/topbanki.ru/httpdocs/classes/modules/deposit/mapper/Deposit.mapper.class.php line 325
Array ( [code] => 1064 [message] => 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 'AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (' at line 1 [query] => ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 437 AND r.rate_proc = 7.70 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 299 AND r.rate_proc = 6.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2612 AND r.rate_proc = 6.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 5598 AND r.rate_proc = 6.35 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 748 AND r.rate_proc = 6.17 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 837 AND r.rate_proc = 5.70 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 6096 AND r.rate_proc = 5.00 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 6097 AND r.rate_proc = 5.00 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2397 AND r.rate_proc = 3.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 297 AND r.rate_proc = 2.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2610 AND r.rate_proc = 2.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2393 AND r.rate_proc = 2.00 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2410 AND r.rate_proc = 2.00 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2398 AND r.rate_proc = 1.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 2412 AND r.rate_proc = 1.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 4412 AND r.rate_proc = 0.50 AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) UNION ( SELECT c.*, r.* , b.company_name, b.company_about_name, b.company_deposit_sum, b.company_deposit_rate, b.company_logo FROM top_deposit_rate as r JOIN top_deposit as c ON c.deposit_id = r.rate_deposit_id JOIN top_company as b ON b.company_id = c.deposit_company_id WHERE c.deposit_id = 436 AND r.rate_proc = AND rate_sum_min < 1400000 AND rate_curr = 'rur' AND ( (rate_term_max_d IS NOT NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_max_d+30) >= 1825) OR (rate_term_max_d IS NULL AND (rate_term_min_d-30) <= 1825 AND (rate_term_min_d+30) >= 1825 ) ) ORDER BY rate_sum_min asc, rate_term_max_d desc LIMIT 1) [context] => /home/httpd/vhosts/topbanki.ru/httpdocs/classes/modules/deposit/mapper/Deposit.mapper.class.php line 325 )