On 12/19/2012 10:07 AM, e-mail mgbg25171 wrote:
Given this I fully understand Ordering by that which I require i.e. non-null...non empty string and the latter of the above does precisely that i.e. when nexttime is not null then 0... and... when lasttime is not null BY CONTRAST the first query SEEMS TO MY NAIVE EYE to contradict my requirement of not null i.e. ORDER BY f.nexttime IS NULL
The expression (f.nexttime IS NULL) evaluates to 0 (which represents "false") when f.nexttime is in fact *not* NULL, and to 1 (true) when it is in fact NULL. In other words, it's a shorthand for
case when f.nexttime IS NULL then 1 else 0 end or equivalently case when f.nexttime IS NOT NULL then 0 else 1 end
BTW NULL = CHR$(0) vs '' = '' YES???
No. NULL is NULL - it doesn't compare equal to anything, not even to itself. For details, see http://en.wikipedia.org/wiki/Null_(SQL)
-- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users