docs:postgres:concatenating_null_strings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docs:postgres:concatenating_null_strings [2008/04/04 14:34] – created billhdocs:postgres:concatenating_null_strings [2008/08/03 00:25] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== concatenating null strings ====== ====== concatenating null strings ======
-In Postgres, when using the || operator to concatenate fields into one string, if any of the fields contain a null value then the result will entirely be a null value.  To avoid this problem, we can use the coallesce function:+In Postgres, when using the || operator to concatenate fields into one string, if any of the fields contain a null value then the result will entirely be a null value.  To avoid this problem, we can use the coalesce function:
 <code sql> <code sql>
 select 'Doe' || ', ' || null || 'John' as name select 'Doe' || ', ' || null || 'John' as name
  • docs/postgres/concatenating_null_strings.1207341288.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)