I run this (sql.txt): create table table1 (age_band); insert into table1 values(31); UPDATE table1 SET age_band = (case when age_band <= 10 then ' 0 - 10' when age_band BETWEEN 11 AND 20 then ' 11 - 20' when age_band BETWEEN 21 AND 30 then ' 21 - 30' when age_band BETWEEN 31 AND 40 then ' 31 - 40' when age_band BETWEEN 41 AND 50 then ' 41 - 50' when age_band BETWEEN 51 AND 60 then ' 51 - 60' when age_band BETWEEN 61 AND 70 then ' 61 - 70' when age_band BETWEEN 71 AND 80 then ' 71 - 80' when age_band BETWEEN 81 AND 90 then ' 81 - 90' when age_band BETWEEN 91 AND 100 then ' 91 - 100' when age_band > 100 then ' over 100' else age_band end); select * from table1;
and get this: SQLite version 3.7.15 2012-11-09 21:40:02 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .read sql.txt age_band ---------- 31 - 40 To sure what might be causing the line break, it only seems to happen for this age band. Staffan On Thu, Nov 22, 2012 at 12:14 PM, Clemens Ladisch <clem...@ladisch.de>wrote: > Bart Smissaert wrote: > > Have a table with one field holding numbers from 0 to about 110. > > The field has no data type, so it is not integer or text. > > [...] > > I thought that as the field has no date affinity, it should be handled > > as integer numbers > > Fields without affinity are never converted without need, and any > number compares less than any string. I'd guess you have strings. > See: > SELECT DISTINCT typeof(age_band) FROM table1 > > > Regards, > Clemens > _______________________________________________ > 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