Re: string is sometimes null ? - Mailing list pgsql-general

From Holger Klawitter
Subject Re: string is sometimes null ?
Date
Msg-id 200409301123.21773.lists@klawitter.de
Whole thread Raw
In response to Re: string is sometimes null ?  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> Is there a concatination operator that will not do this? IE
> var1 || var2 || var3
> and var2 is null would result in just var1var3  ?

You have to coalesce your vars before concatenating, as in

  coalesce(var1,'') || coalesce(var2,'') || coalesce(var3,'')

Mit freundlichem Gruß / With kind regards
    Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBW9CJ1Xdt0HKSwgYRAjg9AJoCA8rZYcDxsdey1neJNjysnPByagCfUIeL
CJT69fhzoIY+RG8btBrPnCA=
=YsB2
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: string is sometimes null ?
Next
From: "Katsaros Kwn/nos"
Date:
Subject: Java application and SPI...(?)