[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] What average is avg()?
From:       Simon Slavin <slavins () bigfraud ! org>
Date:       2014-07-30 13:09:24
Message-ID: B188B422-6794-4632-80F0-181D5FC164E1 () bigfraud ! org
[Download RAW message or body]


On 30 Jul 2014, at 8:51am, Clemens Ladisch <clemens@ladisch.de> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic