我需要StDev
在我的应用程序中计算。它是一个带有 SQLite DB 后端的 Windows 8.1 应用程序。StDev(Column)
是可用的函数,当我直接通过 Visual Studio SQLite 工具箱窗口运行查询时,它返回 StDev 值。但是,当我尝试通过 c# 代码运行相同的代码时,它会返回错误“ no such function: StDev
”。但我可以Avg, Min ,Max
通过代码使用函数。
我的查询:
SELECT Avg(Column1) AS AvgOfColumn1,Sqrt(Column1), StDev(Column1) AS
StDevOfColumn1, Min(Column1) AS MinOfColumn1, Max(Column1) AS MaxOfColumn1
FROM table1 GROUP BY Column2 HAVING Column2 = 154
C#代码:
SQLiteConnection connection = SQLHelper.GetConnection();
{
SQLiteCommand command = new SQLiteCommand(connection);
command.CommandText = sqlMessagesQuery;
command.ExecuteQuery<table1Model>();}
使用上面的代码,我可以检索 Min、max、Avg、Sqrt 但不是 StDev,它在我直接通过 SQLite 工具箱运行查询时运行。
任何帮助表示赞赏。