On 2014/10/07 13:20, Tony Papadimitriou wrote:
Well, it is exactly because I understand the difference between a boolean expression and a non-boolean expression, along with a bit misleading documentation, that I got confused.

It is usually those who are used to only the C-like treatment of a boolean result as being equivalent to an integer result that have no problem with this interpretation. :)

Thank you for clarifying.

There was no malice in the statement, just an honest check.

The fact that it /can/ evaluate to an integer 1 or 0 is coincidental and have nothing to do with the premise I tried to explain, I could have used the words ON and OFF, or TRUE and FALSE, or YES and NO... or, as I did, 1 and 0... a Boolean value is dichotomous and has no other possible state than the base 2 states - so evaluating it and comparing it to an integer supporting 2^64 states or indeed any other type of multi-value field is not useful, and more pertinently, does not work in a CASE statement (or IF() statement for that matter) where expressions need to evaluate to a boolean result, that is the only point.

The reason I pointed out that it might work in cases where the evaluated field (a in your example) /actually has a value/ of 0 or 1 (which can be directly translated to boolean) is only because other people on this forum would quickly launch at the opportunity to correct me if I had simply said "it doesn't work like that at all" - as they should. :)


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to