-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 You can use the coalesce function: coalesce(a, '') || coalesce(b, '') coalesce returns the first argument if it is not null, and returns the second if the first is null. On 30/10/15 06:42, Vijay Krishna wrote:
Hi Sjoerd,
While using the concat function and || operator, if any of the operands are null, then the result becomes null.
For example, if first name is null and last name has some value string, when I concat these two to get the full name, the full name comes as null.
What if null would be treated as an empty character and on concatenation it would give the available operand as result?
P.S. : I agree that we could store the empty character instead of null to get the desired result. But instead of the concat operator showing null for actual values, it could show the least available value.
Thanks & Regards,
Vijayakrishna.P. Mobile : (+91) 9500402305.
On Thu, Oct 29, 2015 at 5:59 PM, Sjoerd Mullender
mailto:sjoerd@acm.org> wrote: On 29/10/15 10:46, Sébastien RAILLARD (PASSMAN) wrote:
Dear all,
Is there a way to concatenate more than 2 strings at once? The CONCAT function only allow for concatenating 2 strings.
You can use the || operator to concatenate strings, and then concatenating more than 2 is easy:
'one' || 'two' || 'three'
Also, hhe JDBC driver for MonetDB reports that the following string functions are supported (see the list below). Are these functions documented somewhere?
ascii char_length character_length code concat copyfrom difference editdistance editdistance2 get_value_for ilike index insert lcase left length levenshtein like locate lower lpad ltrim next_value_for not_ilike not_like octet_length patindex qgramnormalize repeat replace restart right rpad rtrim similarity soundex space splitpart strings substring trim truncate ucase upper
Best regards, Sebastien
_______________________________________________ users-list mailing list users-list@monetdb.org mailto:users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
- -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWMy0CAAoJEISMxT6LrWYgh58IAK/00HESTY5y5cEy0uV1eksa 6XyXv656olvfgG2cnFE5KXiLWcNKUKSqB6Pq6F/qqaTCeY6XTW3uGGJCpDsP3xUq y9V2BVPn5bjuexu61Xce33t7Fq88yn+Qsg1IKV9OzUtk/WhAfTT9fyf5K80VaRT5 1VGKZyN8RzwPdOMSV9t5OBWKdmPUah19DQ7cMbq0iUBi7eDXQAUiyfX/wYUr425E Tl+xujQ/NG+fBdzg93CcVAFyVu1j/4gcIkKx9c7UyQnK64l7Csc1ZcLqvDjhfZ2g +b7EjHjsyh+FfaTcyhIYDz6rHuNWSxhDsHPFM3sk8Zj350jJpPp/i19zOza3rrg= =9unI -----END PGP SIGNATURE-----