Re: coalesce and nvl question

From: Simon Windsor <simon(dot)windsor(at)cornfield(dot)org(dot)uk>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Mike Mascari <mascarm(at)mascari(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: coalesce and nvl question
Date: 2004-06-23 19:19:31
Message-ID: 1088018371.4211.54.camel@celt.cornfield.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

Thanks, I should have thought of that myself!

Simon
On Wed, 2004-06-23 at 19:43, Bruno Wolff III wrote:
> On Wed, Jun 23, 2004 at 19:10:05 +0100,
> Simon Windsor <simon(dot)windsor(at)cornfield(dot)org(dot)uk> wrote:
> > Hi
> >
> > I understand that null and '' are different, and MySQL and Oracle
> > functions are confusing, but my question was not about replacing NULL
> > but replacing Empty strings. These are handled in MySQL/Oracle by the
> > same functions that do NULL checks.
> >
> > Is there a standard function in Postgres that replaces Empty strings, as
> > against a NULL value.
>
> Something like the following may suit your purposes:
> coallesce(nullif(inputstring,''), 'replacement value')
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Simon Windsor
Email: simon(dot)windsor(at)cornfield(dot)org(dot)uk
Tel: 01454 617689
Mob: 07960 321599

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Spruill 2004-06-23 20:03:13 Dump produces file with new line characters
Previous Message Lynna Landstreet 2004-06-23 18:50:40 pgHoster.com woes and looking for a new host