I have a query in raw SQL select * from (select ROW_NUMBER() over(partition by "categoryId" order by "updatedAt" desc) as "RowNum", "categoryId", "updatedAt" from products as tdr) a where "RowNum"=1 How can I perform the same query in Flask Sqlalchemy? I tried different approaches, and found a better solutions in Miguelgrinberg's Cookbook Continue reading...