日期:2014-05-18 浏览次数:20746 次
var query = from x in data select (x.TestDate + x.TestTime - (data.Where(y => y.TestDate + y.DayeTime < x.TestDate + x.DayeTime).OrderBy(y => y.TestDate + y.DayeTime).Select(y => y.TestDate + y.DayeTime).Last()) / x.Eta;
------解决方案--------------------
string sql="select AVG(Eta) as 平均数 datepart('h',TestTime) from table group by datepart('h',TestTime)"