Re: Defining string to represent null values in select

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Defining string to represent null values in select
Date: 2008-11-08 08:44:16
Message-ID: 20081108084416.GA7950@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brent Wood <pcreso(at)yahoo(dot)com> schrieb:

>
> Hi,
>
> I can specify the text used to represent a null value in output from copy, but I'd like to do something similar is select output, eg: all NULL values are represented by NA or NaN.

COALESCE:
test=*# select coalesce(NULL, 'NaN');
coalesce
----------
NaN

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kraftl 2008-11-08 08:44:17 Fulltext index
Previous Message Craig Ringer 2008-11-08 08:40:24 Re: Short CVS question, history