Many thanks to all.
I should have checked - That table was not supposed to be able to even
get strings in there - this exposed a bug in an application of ours too.
Adding check constraints right away.
Thanks!
On 2015/11/25 1:56 PM, Richard Hipp wrote:
> On 11/25/15, Dave McKee <dragon at scraperwiki.com> wrote:
>> I can replicate this behaviour if I insert a zero-length string into the
>> column.
>>
>> sqlite> create table foo(a);
>> sqlite> insert into foo values(5);
>> sqlite> insert into foo values("");
>> sqlite> select max(a) from foo;
>>
>> sqlite> select min(a) from foo;
>> 5
>> sqlite> select avg(a) from foo;
>> 2.5
>>
>> Is this a possible explanation?
>>
> Indeed. Ryan sent me the database via private email:
>
> sqlite> select typeof(max(unitcost)), length(max(unitcost)) from bomdata;
> text|0
>