Re: [sqlalchemy] Using joins+max with sql server

2023-04-14 Thread Elias Coutinho
. > > also I dont think you'd want to "group by" the same column that you are > feeing into max().that would defeat the purpose of using an aggregate. > > On Fri, Apr 14, 2023, at 1:30 PM, Elias Coutinho wrote: > > Good afternoon. > I am having trouble tra

[sqlalchemy] Using joins+max with sql server

2023-04-14 Thread Elias Coutinho
Good afternoon. I am having trouble transforming a SQL Server query to SQL Alchemy. *The SQL Server query is this* SELECT CP.CdChamada, P.NmProduto, PE.VlPrecoCusto, PE.VlPrecoSugerido, EE.QtEstoque, EE.DtReferencia FROM Produto P INNER JOIN Produto_Empresa PE ON P.IdProduto = PE.IdProduto IN