Hello! On Saturday 31 October 2009 02:31:44 Simon Slavin wrote: > > On 30 Oct 2009, at 9:47pm, Alexey Pechnikov wrote: > > > Now SQLite think that 1 is equal to '1' in some causes and think > > different in other. > > Just like every other language, once you get into it you have to learn > how the language works to understand what's going on. Your problem is > not really with the comparison, it's with what happens to a value when > it is stored in a table. Strongly typed languages usually do one of > two things: > > A) not allow the comparison at all (you get a syntax error from the > compiler) > > B) say that two values of different types never equal one-another
You did forget the third way: C) convert values to same type before comparision In C the comparision some of different types is valid: int x =1; double y=2; if (y>x) ... The internal representation of the integer and of the double is different and internal conversation is needed. Most modern languages make this for string values too. In Tcl value can has string or numeric internal representation and is converted before comparison. When values can have the same type and is equal than the result of equality check is positive. When values doesn't have the same type or have the same type but isn't equal than equality check is negative. Best regards, Alexey Pechnikov. http://pechnikov.tel/ _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

