10 ms·
>> Further, while >= and > can both be reversed to <= and < (and thus adding them in this RFC might be considered excessive or unnecessary) False. You need all
by adontz 5y ago
>> Further, while >= and > can both be reversed to <= and < (and thus adding them in this RFC might be considered excessive or unnecessary)
False. You need all operators because for database NULL-alike logic you cannot infer results from one half of operators.
NULL < NULL == false
NULL > NULL == false
- pansa2 5y agoCan’t you rewrite the second of those so it becomes the first, hence rewriting `>` into `<`?
- adontz 5y agoNo. NULL compared to anything in any way is false. http://sqlfiddle.com/#!4/d8fff5/14/0 http://sqlfiddle.com/#!4/d8fff5/14/0 http://sqlfiddle.com/#!17/9eecb/83597/0 http://sqlfiddle.com/#!17/9eecb/83597/0 http://sqlfiddle.com/#!18/9eecb/142653/0 http://sqlfiddle.com/#!18/9eecb/142653/0
- pansa2 5y agoYou still don’t need `>` for any of those examples though, do you? For example, `NULL > 1` could be rewritten as `1 < NULL` (even though it can’t be rewritten as `not(NULL <= 1)`.
- adontz 5y agoWhat do you mean by rewritten? In func_a() > func_b() I expect left-to-right execution order. Not that it should matter in a good code, but anyway.
- junon 5y agoI agree entirely, you should comment on the RFC for this usecase (binding to database objects). It would be super helpful. :)