Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Concatenation containing a "null" term



(I am certain I once saw the answer to the following question, but I can't for the life of me find out where!)

I create a View as

SELECT (firstname || ' ' || lastname)::character(50) AS fullname
FROM name_table;

firstname and lastname are text columns, and firstname may be null.

Unfortunately, it seems that whenever firstname is null, the resulting fullname is null also.  Is there a way of having the null-strings terms of the concatenation operator be considered as empty strings instead?

Thanks for the help!


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group