In MySQL,
CONCAT('foo', 'bar', NULL) = NULL
the NULL always wins in MySQL.
If you would rather treat NULL as an empty string, use
CONCAT_WS
Show archive.org snapshot
(concatenation with separator) instead:
CONCAT_WS('', 'foo', 'bar', NULL) = 'foobar'
PostgreSQL
In PostgreSQL the NULL
is not viral in CONCAT
:
CONCAT('foo', 'bar', NULL) = 'foobar'
Posted by Tobias Kraze to makandra dev (2010-10-29 09:39)