SQLite - how to get average value?

后端 未结 4 1403
后悔当初
后悔当初 2021-01-07 19:25

I have in my table a column that has values of type FLOAT. How can I get average value of all elements in this column?

相关标签:
4条回答
  • 2021-01-07 19:31
    SELECT AVG(column) FROM ...
    
    0 讨论(0)
  • 2021-01-07 19:32
    select avg(column) from table;
    
    0 讨论(0)
  • 2021-01-07 19:38
    select avg(col1) from table;
    
    0 讨论(0)
  • 2021-01-07 19:43
    select avg( columnname) from table;
    

    This will average all rows. To average a subset, use a where clause. To average for each group (of something) use a group by clause.

    0 讨论(0)
提交回复
热议问题