Re: Replace null values

From: Nilesh Govindarajan <lists(at)itech7(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Replace null values
Date: 2010-03-23 04:39:16
Message-ID: 4BA845F4.5030506@itech7.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/23/2010 10:07 AM, John R Pierce wrote:
> Nilesh Govindarajan wrote:
>> Hi,
>>
>> In my query, some rows have null values (length 0).
>
> a NULL value is not length 0, NULL is not the empty string, rather, NULL
> is no value at all.
>
> if you want to change a 0 length string to something, use a CASE or
> something.
>
> select CASE WHEN u.name = '' THEN 'anon' ELSE u.name, ....
>
>
>
>
>

Thanks a lot ! It worked :)

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nilesh Govindarajan 2010-03-23 04:45:07 Re: Replace null values
Previous Message John R Pierce 2010-03-23 04:37:04 Re: Replace null values