I'm applying this following query in C#:
var query = from b in db.SalesOrderHeaders
where b.SubTotal > (from c in db.Employees
join v in db.EmployeePayHistories
on c.BusinessEntityID equals v.BusinessEntityID
select v.Rate)
select new
{
b.BusinessEntityID,
b.SubTotal,
};
But an error is returned: linq and face error: Operator '>' cannot be applied to operands of type 'decimal' and 'System.Linq.IQueryable<decimal>'
.
Both b.subtotal
and v.rate
are decimal type and I want to compare these two. Any help is appreciated.