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

case statement to cath nulls on joined tables

From: John Morgan <jdmorgan(at)unca(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: case statement to cath nulls on joined tables
Date: 2012-02-03 12:45:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin

I am doing a left outer join between a polygon table and a data table.
returns fine from this join as expected.  However, there are cases where
there isn?t data for a given polygon and this return as the expected null
in the result set.  I would like to utilize something like a case statement
to catch the nulls and return a ?more friendly? message.  I have tried
unsuccessfully to use the following logic:

*Select case value_of_interest null then ?more friendly message? else
value_of_interest end*

*From poly_table left outer join data_table one poly_table.common_id =

If someone could let me know where I am going wrong it would be greatly




pgsql-admin by date

Next:From: Matheus de OliveiraDate: 2012-02-03 15:05:39
Subject: Re: case statement to cath nulls on joined tables
Previous:From: Javier ReyesDate: 2012-02-03 10:50:39
Subject: Equivalent plpgsql trigger in C

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