开发者

multiple column selection with aggregate function in LINQ dictionary

I was unable to cope with converting 开发者_JS百科this Sql Query to Linq Expression

SELECT IdVehicle, AVG(Kilometers) FROM [Fuel] GROUP BY IdVehicle, CONVERT(NVARCHAR, Fuel.Time, 102)

Rows are inserted into this table when someone fills fuel into vehicle. Kilometers are read from tachograph. It's possible to fill fuel twice a day so I need average value. Ideally, LINQ result would be Dictionary.

I would really appreciate any suggestion.


For cases like these you might wanna try LinqPad (www.linqpad.net). This great tool lets you test and analyze both SQL statements and Linq expressions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜