Re: NULLS and string concatenation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NULLS and string concatenation
Дата
Msg-id 13631.1100894502@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: NULLS and string concatenation  (Don Drake <dondrake@gmail.com>)
Ответы Re: NULLS and string concatenation
Список pgsql-sql
Don Drake <dondrake@gmail.com> writes:
> This is still strange to me.  In Oracle, the same query would not
> replace the *entire* string with a NULL, it treats the NULL as a no
> value.

Oracle is a bit, um, standards-challenged.  They fail to make a
distinction between an empty string and a NULL, but such a distinction
is both logically necessary and required by the SQL standard.

> I can't find in the documentation where string concatenation of any
> string and NULL is NULL.

SQL92 section 6.13 <string value expression>, General Rule 2a:
           a) If either S1 or S2 is the null value, then the result of the             <concatenation> is the null
value.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: NULLS and string concatenation
Следующее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: NULLS and string concatenation