I would think so.  You're asking for the minimum value of what is
encountered.  Follows along the line of count as well.

The minimum return is going to be zero or null (I've not checked), but,
you're asking for an absolute answer that will return some sort of value.

On Fri, Feb 22, 2013 at 3:06 PM, Pierre Chatelier <k...@club-internet.fr>wrote:

> Hello,
>
> [tested under 3.6.12 and 3.7.15.2]
>
> I have a question regarding the use of aggregate functions.
>
> Let's imagine the following db :
> >create table A (id1 INTEGER UNIQUE PRIMARY KEY, id2 INTEGER);
> It is empty.
>
> The following query :
> >select id1,id2 from A;
> returns nothing, there is no row.
>
> However, the following query, using the aggregate min() :
> >select min(id1),id2 from A;
> returns an empty line (displays '|' in the shell).
>
> Using avg(), max()... will do the same.
>
> With the C interface, SQLITE_ROW is returned, and I must test
> sqlite_column_type() against SQLITE_NULL to check that in fact, there is no
> result.
>
> Is this expected behaviour ?
>
> Regards,
>
> Pierre Chatelier
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to