I have this line of code (using MSSQL
):
double avg = db.MyTable.Where(x => x.RecordDate < today).Select(z => z.value).Average();
I wonder if this is translated to SQL
AVG()
function or the Average()
run on client side ?
This table contains 50,000 records per day and I prefer to let the database calculate the average and pass back only a single value.
And, how can I see the SQL
query sent to the database ?