I'm developing a system in ASP.NET MVC that defaults to but I'm in need of a select over another select , and I do not know how to do this with Entity . The SQL code you would like to use is the following:
select * from pedidos as p
inner join agendamentos as a
on a.pedidoID = p.pedidoID
where a.data = (select max(data) from (select a.data from pedidos as p
inner join agendamentos as a
on a.pedidoID = p.pedidoID
where a.realizado = 0) as dataagendamentos);
If someone can help me, I'll be grateful!