0
我必须在此基础上类匹配类中的所有字段列名的表:有没有办法使用SQLITE只使用一个SQL来获取四列中的值的平均值?
public class ClickHistory
{
[PrimaryKey, NotNull]
public string Yymmdd { get; set; }
public int DayOfYear { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public int Day { get; set; }
public int BtnACount { get; set; }
public int BtnBCount { get; set; }
public int BtnCCount { get; set; }
public int BtnDCount { get; set; }
}
我想什么做的是让所有的BTN的SAM的平均值..列在表格的所有行上。
我已经得到这样一个行的计数:
return db2.ExecuteScalar<int>("SELECT (BTNACOUNT + BTNBCOUNT + BTNCCOUNT + BTNDCOUNT) FROM CLICKHISTORY WHERE YYMMDD = " + yymmdd);
}
但我怎么可以改变这个,所以我可以在所有行得到一个平均?