I am trying to make a query using sqlalchemy
df=pd.read_sql_query('SELECT * FROM `all-data`.indicators_ft \
WHERE country= "United States" AND name="Average Hourly Earnings % m/m" ', engine)
However that specific query doesnt work. I isolated the problem and it is in the expression "Average Hourly Earnings % m/m"
. I suspect it is because of the %
or /
symbol that would need to be escaped. But how to do that? I tried backslashes but they didnt work.
subsidiary question: I also tried NAME LIKE "Average Hourly Earnings%"
to bypass the problem but it didnt work either - how to do a LIKE
query in sqalchemy?
NB: I tried both those queries in mysql workbench and they did work.
Thx!