I am using sqlAlchemy SQL Expression Language as follows:
col_name = 'variable_col' metadata = MetaData(db) myTable = Table('table_name', metadata, Column(col_name, Integer)) s = myTable.select() for rec in conn.execute(s):
What I'm trying to accomplish is to arrange desc results in a column and only in the result set.
I tried using the following:
s.order_by(desc(myTable.c)) s.order_by(desc(myTable.c[0]))
I even tried creating a Column object and arranging it like this:
temp_col = Column(col_name, Integer) s.order_by(desc(temp_col))
All to no avail. Results are returned as if there was no order_by clause.
Any help would be appreciated.
source share