COALESCE documentation
От | Navrátil, Ondřej |
---|---|
Тема | COALESCE documentation |
Дата | |
Msg-id | CAEELDaqnn5GayihUUhnKLR1_fegb-_b2i+4_dP4U192uK7j9vw@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: COALESCE documentation
Re: COALESCE documentation |
Список | pgsql-docs |
Hello,
--
as per documentation
> The
COALESCE
function returns the first of its arguments that is not null. Null is returned only if all arguments are null.This is not exactly true. In fact:
The
COALESCE
function returns the first of its arguments that is distinct from null. Null is returned only if all arguments are not distinct from null.See my stack overflow question here.
Long story short
select coalesce((null, null), (10, 20)) as magic;
returns
magic
------- (,)
(1 row)
However, this is true:
select (null, null) is null;
Ing. Ondřej Navrátil, Ph.D.
IT Analytik
M +420 728 625 950
E onavratil@monetplus.cz
MONET+,a.s., Za Dvorem 505, 763 14 Zlín-Štípa
monetplus.com | linkedin | facebook
В списке pgsql-docs по дате отправления: