On 2013/12/22 20:53, James K. Lowden wrote:
Similarly any attribute can be Boolean if it is found to be an
attribute of an object. Giuseppe is not Boolean, but he is human and
likely male, so that: (Giuseppe = Human) is true or 1, and
(Giuseppe = Female) is false or 0.
For RDBMS and indeed most programming languages, any Boolean
evaluated result can directly be inferred as the arithmetic values 0
and 1 so that I could make some programmatic assumptive statements
based
Yes, it's a bit of a trick.
Boolean logic operates on true and false values. Any two distinct
symbols can be used. It so happens SQLite apparently uses
1 and 0, but e.g. -1 and 0 or 'T' and 'F' would serve as well.
True, when a character interpretation is given, but when converted to a value, as in Integer Byte value, it is always 1 and 0 with
every compiler in existence - however this may not necessarily be the case in SQL (I will have to look up the Standard to actually
confirm this), but it _is_ the case with SQLite on any platform because the interpretation is subjective to the SQLite engine's
interpretation of parsed SQL and not the storage medium or processor of the target platform, as opposed to register bit-quantities
and the like, as far as I know.
Good point to notice or remind people of, when asking questions here and may
try to use similar methods on other SQL engines.
stats.quantity * (stats.which_month = 1)
is *logically* nonsensical: the product of a numerical quantity and a
a logical one. What would, say, "7 times false" mean?
"false false false false false false false"?
Haha, that is really ( false ^ 7 ), which is not true!
I wonder if ( true! ) = true...
( 7 * false ) is false - obviously... but ( 7 * True ) can still be false - if
you try to argue with my ex wife.
Cheers!
Ryan
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users