1# If you're using SQLAlchemy:
2# Use "%%" instead of "%" in your queries, because
3# a single "%" is used in Python string formatting.
4
5# Alternatively escape the SQL properly with sqlalchemy.text(...):
6engine.execute(sqlalchemy.text(sql_query))
1you need to use %% in python for % you are using in your like statements. % in python is used for string formatting