How do I escape the % from a mysql query in python.
For example
query = \"\"\"SELECT DATE_FORMAT(date_time,\'%Y-%m\') AS dd FROM some_table WHERE som
Literal escaping is recommended by the docs:
Note that any literal percent signs in the query string passed to execute() must be escaped, i.e. %%.
execute()
%%