On May 5, 2014 11:36 AM, "Stephan Beal" <sgb...@googlemail.com> wrote: > > I mean ‘where 1’, or ‘where ‘1 - 1’, or ‘where null’, or ‘where 0 / 0’, or > > any of this nonsense. There is nothing to compare. It’s nonsensical. > > Oh, but there is: 1-1 is an expression, the result of which is integer 0 > (as opposed to string '0'), which, in all programming environments except, > IIRC, Xenix, is boolean false. In fact, the sqlite shell makes a handy ad > hoc calculator for exactly that purpose: > > sqlite> select 1-1; > 0 > sqlite> select typeof(1-1); > integer
I personally have no problem with SQLite's implicit conversion between types, but I can appreciate why it would frustrate some people because no other SQL parser I have tested (1 oracle, 2 SQL Server, and 2 or more of MySQL and PostgreSQL) allows that construct, generating errors due to an incorrect expression or some such. That being said, SQLite already deviates from "tradition" in many respects. Given its origin as a C library to provide small fast database access, it makes perfect sense to me why it works this way. Of things that could be improved, this particular syntax checking issue is no where near the top of my list (or would not be if I had such a list). What I really want is a SQL variant that reads my mind via a DWIM interface. "Do What I Mean" is a powerful paradigm, and DRH is just the guy to deliver it! ;) _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users