21 r <<
select(
"avg(" + column_name +
")").from(db, table_name);
30 auto r = query<double>(
32 "select avg("s + column_name +
")" +
" from (select " + column_name +
33 " from " + table_name +
" order by " + column_name +
34 " limit 2 - (select count(*) from " + table_name +
") % 2" +
35 " offset (select (count(*) - 1) / 2" +
" from " + table_name +
"))");
44 auto r = query<double>(db,
45 "select sum("s +
"(" + column_name +
"-(select avg(" +
46 column_name +
") from " + table_name +
"))" +
"*" +
47 "(" + column_name +
"-(select avg(" + column_name +
48 ") from " + table_name +
"))" +
" ) /" +
"(count(" +
49 column_name +
")) from " + table_name);
T unique_value(query_result< T > const &r)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
auto select(T const &...t)
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)