Skip to content
Advertisement

How to get column names from a SQL query?

I need to put data from the SQL query into a Pandas dataframe. Please tell me is it possible to get column names the query results? I found that there is a keys() function in sqlalchemy for that but it does not work for me:

AttributeError: ‘CMySQLCursor’ object has no attribute ‘keys’

Advertisement

Answer

I think that it your are searching for

Hope this helps!

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