0

In sqlalchemy, the result object returns me the data row by row, I want the query to return the me data column by column.

query = self.controller.ListAll(query) # returns <class 'sqlalchemy.engine.cursor.LegacyCursorResult'>

output ==> (1,Carlson,1000),(2,Jack,2000)

the result i want:

output ==> (1,2),(Carlson,Jack),(1000,2000)

The query is constantly changing. I couldn't find a defined function that returns the result object column by column. Should I write a function to return the value it returns to the output I want or is there another way to do this?

Django
  • 160
  • 2
  • 13

0 Answers0