On Oct 25, 2005, at 10:02 AM, Dennis Cote wrote:
..
The following shows what happens when some sample data is imported
into tables with different column types (note the spaces after the
commas in the last three rows).
1,2,3
3.14,1.414,2.718
5+6,7-8,9*9
1, 2, 3
3.14, 1.414, 2.718
5+6, 7-8, 9*9
SQLite version 3.2.7
Enter ".help" for instructions
sqlite> create table t (a, b integer, c real);
sqlite> .separator ,
sqlite> .import test.csv t
sqlite> select * from t;
1,2,3
3.14,1.414,2.718
5+6,7-8,9*9
1, 2, 3
3.14, 1.414, 2.718
5+6, 7-8, 9*9
sqlite> select typeof(a), typeof(b), typeof(c) from t;
text,integer,integer
text,real,real
text,text,text
text,text,text
text,text,text
text,text,text
sqlite> select sum(a), sum(b), sum(c) from t;
18,10.414,14.718
this is a great explanation, but, why does 1,2,3 return as
text,integer,integer and not integer,integer,integer?
--
Puneet Kishor