Question Details

No question body available.

Tags

python pandas pymysql

Answers (1)

February 6, 2026 Score: 0 Rep: 46,063 Quality: Low Completeness: 50%

The typical way of adding a comment to a SQL query is as follows: / I am a comment /. You, however, are using # I am a comment, which is causing your issue. Get rid of your comments in the query or use / ... /:

...

query = """ SELECT FROM reservoir_minutely WHERE facility_id = %s / 11 / AND collected_at >= %s / '2024-01-01 00:01' */ AND collectedat < DATEADD(%s, INTERVAL 3 HOUR) ORDER BY collected_at ASC """

...