From: Jean-Christophe Deschamps Sent: Monday, December 05, 2016 9:48 AM To: SQLite mailing list Subject: Re: [sqlite] Problem with CASE in WHERE clause
> > At 06:29 05/12/2016, you wrote: > >My app supports sqlite3, SQL Server, and PostgreSQL. > > > >SQL Server has a ‘bit’ data type, which accepts 1/0 and > >‘1’/’0’ as valid values. > > > >PostgreSQL has a ‘bool’ data type, which supports a variety of > >values TRUE, ‘t’, ‘true’, ‘yy’, ‘yes’, ‘on’, > >‘1’ for true, and the opposites for false, but does not allow 1/0. > > All [three] engines should support (1=1) and (1=0) for true and false, > respectively, as well as bare columnname as a boolean assertion, like > Simon said: select ... where columnC and not columnF ... > > The choice of literals representing true and false is merely cosmetic. > So if I understand correctly, it makes sense to use ‘1’/’0’ to *set* the boolean value in a cross-database manner, but there are a variety of ways to test for it. Frank _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users