On 10/07/2012 9:58 AM, bardzotajneko...@interia.pl wrote:
SQLite version 4.0.0 2012-07-07 12:21:48
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t(a);
sqlite> insert into t values(123);
sqlite> insert into t values(123.0);
sqlite> insert into t values(12323);
sqlite> insert into t values(12323.0);
sqlite> select * from t group by 1;
123.0
12323
12323.0
sqlite>
This is correct: 123 != 123.0 != "123" because they all have different types (int/float/string). Either create the table with typed columns to encourage all values to have the same type [1] or cast the group by key to coerce all values to the same type (not sure what happens if the type cast fails).

[1] See the SQLite docs for rules about automatic type conversions for typed columns, it's not a panacea.

Ryan

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

Reply via email to