Hi, Suppose I have a table Blah(colA int, colB int) and I am using session.query() to query its rows.
my_results = session.query(Blah.xxx.label("my_result").first() I want to be able to have a python flag such that, depending on its value colA or colB gets selected as the result column. Please help me replace xxx in the query above to achieve this. In this toy example I could just copy the query inside an if statement, but the actual query I'm trying to build is large and I don't want to duplicate it. Thanks in advance, Sergei. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.