Categories
Uncategorized

Python Strings

I was working on a slightly convoluted MySQL query in Python. I added some additional formatting to the SELECT and the query failed. It is not that big a query but Python threw an error.

I had to break it up into three strings and re-assemble them to make it work. It seems a little silly to have to do this and it seems very strange that it works.

querySelect=”””SELECT …”””

queryFrom=”””FROM … JOIN …”””

queryWhere=”””WHERE …”””

query=querySelect+" "+queryFrom+" "+queryWhere

Leave a Reply