Search found 1 match

by mcw14
Tue 28 Apr 2009 14:21
Forum: dotConnect for PostgreSQL
Topic: "outer apply" statement
Replies: 12
Views: 7279

Has there been any progress made with constructing the correct sql statement for oracle when "outer apply" is being generated for the sql server statement? My linq to entity query is below. This query uses MAX to find the Products that have the highest unit price in each category. The problem lies with the g.Max(p3 => p3.UnitPrice). I believe this is where the outer apply is being generated since the APPLY operator allows you to invoke a table-valued function for each row returned by an outer table expression of a query. Can this be translated in your provider to oracle syntax?

var query = from p in Context.Products
group p by p.Category.CategoryID into g
select new {
g.Key,
MostExpensiveProducts =
from p2 in g
where p2.UnitPrice == g.Max(p3 => p3.UnitPrice)
select p2
};