Skip site navigation (1) Skip section navigation (2)

Re: problems with SELECT query results

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Brian Hurt <bhurt(at)janestcapital(dot)com>, Joshua <joshua(at)joshuaneil(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: problems with SELECT query results
Date: 2007-05-29 16:32:47
Message-ID: 997252.72262.qm@web31808.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
--- Brian Hurt <bhurt(at)janestcapital(dot)com> wrote:
> Check for nulls.  Remember that 'foo' || NULL yeilds NULL, so if one of 
> your fields is null, the whole string will be null.

Also, if you know the nulls will be present, and you want a way to handle them is a predetermined
way, you can wrap your fields like so: COALESCE( yourfield, 'oops value is null') or some such.

http://www.postgresql.org/docs/8.2/interactive/functions-conditional.html#AEN13107

I hope this helps.

Regards,
Richard Broersma Jr.

In response to

pgsql-novice by date

Next:From: JoshuaDate: 2007-05-29 16:43:45
Subject: Re: problems with SELECT query results
Previous:From: Brian HurtDate: 2007-05-29 16:20:32
Subject: Re: problems with SELECT query results

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group