Re: Replace null values - Mailing list pgsql-general

From John R Pierce
Subject Re: Replace null values
Date
Msg-id 4BA84570.2090000@hogranch.com
Whole thread Raw
In response to Replace null values  (Nilesh Govindarajan <lists@itech7.com>)
Responses Re: Replace null values  (Nilesh Govindarajan <lists@itech7.com>)
List pgsql-general
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,  ....





pgsql-general by date:

Previous
From: Nilesh Govindarajan
Date:
Subject: Replace null values
Next
From: Nilesh Govindarajan
Date:
Subject: Re: Replace null values