Thanks for the link <http://www.sqlite.org/datatype3.html>. In section
6 of this page there is mention of Affinity Modes, how do you activate
these?

As it is now you can get completely irrational behavior with
mathematical operators:

sqlite> create table temp (a INTEGER);
sqlite> insert into temp values("1");
sqlite> insert into temp values("1.9");
sqlite> insert into temp values("2hello");
sqlite> insert into temp values("hello2");
sqlite> select * from temp;
a
----------
1
1.9
2hello
hello2

sqlite> select sum(a) from temp;
sum(a)
----------
4.9

sqlite> select sum(a) from temp where a = "2hello";
sum(a)
----------
2

sqlite> select sum(a) from temp where a = "hello2";
sum(a)
----------
0

That is just irrational. str("2hello") should always return an error
or null or maybe even  0, but surely not 2. Is this some kind of
casting behavior inherited from C?

Also, significant white space between delimiters? ",0.9," is numeric
", 0.9," is text. That isn't very friendly.

David


On 10/25/05, Brass Tilde <[EMAIL PROTECTED]> wrote:
> > >    sqlite> create table t (a, b integer, c real);
>
> > this is a great explanation, but, why does 1,2,3 return as
> > text,integer,integer and not integer,integer,integer?
>
> I suspect that it's because no type was specified for field 'a', so
> everything is interpreted as text.
>
> Brad
>
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays

Reply via email to