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 discount_type='A' order by price_range desc limit 1' at line 1
select * from SC_order_price_discount where price_range<= and discount_type='A' order by price_range desc limit 1