Re: How to pickup null values in SQL Language? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: How to pickup null values in SQL Language?
Date
Msg-id 20020530225301.E51109-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: How to pickup null values in SQL Language?  (Tahira Aslam <tahira_aslam@yahoo.com>)
Responses Re: How to pickup null values in SQL Language?
List pgsql-general
On Thu, 30 May 2002, Tahira Aslam wrote:

>  Select Coalesce(cast(MyView."Document_ID" as
> Text)||','||cast(MyView."First_Name" as
> Text)||','||cast(MyView."Last_Name" as
> Text)||','||cast(MyView."Sent_Date" as Text),'NONE') From "MyView"
> Where "Document_ID"=$1;

If you want a part of the string to become NONE if null, you need
to coalesce each part (I'm dropping the casts for now):
select coalesce(MyView."Document_ID", 'None') || ',' ||
 coalesce(MyView."First_Name", 'None') || ...




pgsql-general by date:

Previous
From: Kay-Uwe Michaelis
Date:
Subject: How to rebuild tables
Next
From: Tahira Aslam
Date:
Subject: Re: How to pickup null values in SQL Language?