Skip to content
Advertisement

SQL Comparison Operator Issue) …right syntax to use near ‘>’2021-06-01’ AND 100*(d1_close-close)/close>’29” at line 1″)

I’m trying to run a SQL query through python file, and I’m getting the error message

My query code is as below:

I have also tried different versions like below:

UPDATE)) I think the syntax error is in the comparison operator. How can I send comparison operator from python to SQL?

Advertisement

Answer

Triple quotes allow you to write the query without string concatenation because the strings can span multiple lines:

This also makes it easier to test because you can just copy the query to another tool to run it.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement