Subquery with SQLAlchemy with groupby and orderby

423 Views Asked by At

I am working on change my python code from db.engine.execute to proper SqlAlchmy manner, But I am stuck with a query having subquery with group_by and order_by.

select * from (select * from table1 where value='a' or value='b' or value='c' order by value1 ) as a group by value2;

Is it possible to write this query in sqlalchemy way ?

0

There are 0 best solutions below