On Mon, May 5, 2014 at 6:56 PM, Petite Abeille <petite.abei...@gmail.com>wrote:
> > select 1 where 1 = 1; > > Indeed. I would have expected a syntax error along the lines of 'invalid > relational operator’ or such. And that’s that. > Why expect an error? It's abstractly the same as saying WHERE 'a' = 'b', and internally sqlite doesn't really know that it's comparing two constants with the same value until it has compared them to figure that out unless its optimizer does that somehow, but the end result must be the same with and without the optimizer. i.e. it's just a normal comparison operation, for all intents and purposes, and 1=1 === true in all languages i've worked with (except that SQL uses '=' instead of '==' or '===', but that's just a syntactical difference). (NaN tends to have unusual comparison rules, though, e.g. NaN does not compare equal to itself in some languages.) -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users