1

I need to calculate StDev in my application. Its a Windows 8.1 application with SQLite DB backend.StDev(Column) is the function available and it returns the StDev value when i run the query directly through Visual Studio SQLite toolbox window. But, when i try to run the same through c# code, it returns the error "no such function: StDev". But I am able to use Avg, Min ,Max functions through the code.

MyQuery :

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# Code:

SQLiteConnection connection = SQLHelper.GetConnection();
{
SQLiteCommand command = new SQLiteCommand(connection);
command.CommandText = sqlMessagesQuery;
command.ExecuteQuery<table1Model>();}

With this above code, I can retrieve Min,max,Avg,Sqrt but not StDev which runs when i run the query directly through SQLite toolbox.

Any help appreciated.

Raj
  • 319
  • 1
  • 3
  • 18
  • Neither `Sqrt` nor `StDev` are [built-in functions](http://www.sqlite.org/lang_aggfunc.html). – CL. Aug 09 '17 at 11:19
  • But both works and returns expected result when i run the query directly in Visual Studio SQLite toolbox. – Raj Aug 09 '17 at 13:53

0 Answers0