On Wed, Nov 23, 2011 at 12:20 PM, Petite Abeille
<petite.abei...@gmail.com> wrote:
> On Nov 23, 2011, at 6:05 PM, Pavel Ivanov wrote:
>
>>  This query gives
>> different and kind of unexpected result on empty table. ;)
>
> Ooops... I see what you mean... on an empty table... this returns one row 
> with a null value:
>
> sqlite> select max( 1 ) from t;
>
>
> That would qualify as a bug I guess :))

No, it's not a bug. It's SQL standard that such form of aggregate
query always returns one row. And when there's no rows in the table it
should return NULL (for all aggregate functions except count() which
returns 0). I said it's kind of unexpected because it seems like
max(1) should always return 1 but it turns out it doesn't always do
so.


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

Reply via email to