Re: [sqlite] What average is avg()?

2014-07-30 Thread Simon Slavin

On 30 Jul 2014, at 8:51am, Clemens Ladisch  wrote:

> Jonathan Moules wrote:
>> Which type of average does avg() calculate?
>> 
>> I guess it's the mean, but it could be median or mode, so worth asking.
> 
> The SQL standard says it's the mean.

Might be worth noting that avg() treats null values the same way that sum() 
treats nulls: it ignores them and does not include them in the divisor, unless 
all the values are null, in which case it returns null.  This may not be what 
you are expecting.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What average is avg()?

2014-07-30 Thread RSmith
The convention, as far as I am aware, is "Average" always refers to the "Mean Average" unless explicitly stated otherwise.  Modes 
and Medians are usually specific to certain arms of the calculati.


Having said that, probably a good idea to add the note to the docs regardless.

On 2014/07/30 09:38, Jonathan Moules wrote:

Hi List,
A question and possible suggestion.

Which type of average does avg() calculate? The documentation doesn't say -
https://www.sqlite.org/lang_aggfunc.html

I guess it's the mean, but it could be median or mode, so worth asking.

My suggestion would be to include an explicit statement in the docs saying
which it is to make it clearer for users.

Cheers,
Jonathan



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What average is avg()?

2014-07-30 Thread Clemens Ladisch
Jonathan Moules wrote:
> Which type of average does avg() calculate?
>
> I guess it's the mean, but it could be median or mode, so worth asking.

The SQL standard says it's the mean.


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] What average is avg()?

2014-07-30 Thread Jonathan Moules
Hi List,
A question and possible suggestion.

Which type of average does avg() calculate? The documentation doesn't say -
https://www.sqlite.org/lang_aggfunc.html

I guess it's the mean, but it could be median or mode, so worth asking.

My suggestion would be to include an explicit statement in the docs saying
which it is to make it clearer for users.

Cheers,
Jonathan

-- 
This transmission is intended for the named addressee(s) only and may 
contain confidential, sensitive or personal information and should be 
handled accordingly. Unless you are the named addressee (or authorised to 
receive it for the addressee) you may not copy or use it, or disclose it to 
anyone else. If you have received this transmission in error please notify 
the sender immediately. All email traffic sent to or from us, including 
without limitation all GCSX traffic, may be subject to recording and/or 
monitoring in accordance with relevant legislation.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users