Hello,

On 2018-05-17 10:40, Dominique Devienne wrote:
On Wed, May 16, 2018 at 8:33 PM Keith Medcalf <kmedc...@dessus.com> wrote:


SELECT coalsce((select action
                   from blocked
                  where mail='...'), 'OK') as action;


Nice one Keith. Works (see below), but I find it a bit intuitive,
since returning no row is somehow not intuitively equivalent (in my mind at
least)
to a scalar row with a NULL value. Your query makes no distinction between
these two cases.

Quite justly -- let us not introduce multi levels of non--existence (a source of many bugs):

(1) semi non--existence / a value ``NULL'' / a person saying ``Hello, I do not exist'';

(2) virtual non--existence / a value ``UNDEFINED'' / a person not existing virtually, because it is silenced (though breathing);

(3) literal non--existence / a value not existing literally / a person not existing literally;

A NULL column (blocking) ``action'' in a table ``blocked'' is an error and should be avoided -- it means ``you are blocked, but I do not know how''. If someone wants a (lately bound) default action, let the name be ``DEFAULT'' -- not NULL.

-- best regards

Cezary H. Noweta

P.S. I know it is hard to return to a life after a programming in some very flexible lang, in which every even simplest task can be done in a trillion ways :)
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to