Good Afternoon
In a table where it is always inserted new records can occur to have the same Date and the same RateCode, however I want to get a list of this table but for each Date group, RateCode would like me to return the last record inserted, it will always be the last line inserted, as I am using Entity Framework I can not run the query to return the result, I believe it is better to use lambda or LINQ to filter the data, however, I do not have much experience in complex applications and so far I am able to implement logic, in SQL would filter this way in the simplest way.
select a.*
from DailyRates a
join (select Max(Id) as Id, Date, RateCode
from DailyRates
where RoomTypeId = 79
group by Date, RateCode) b on a.id = b.id