coalesce a null to a char ?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: coalesce a null to a char ?
Date: 2009-04-06 21:55:58
Message-ID: 482E80323A35A54498B8B70FF2B8798003F77719FA@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How can I do this....

selcet coalesce((select 'y' from foo where name = f.name),'n') from foo f where...

So the query returns a "y" or "n" depending on whether or not the subquery is null.

I get...

"ERROR: failed to find conversion function from unknown to text"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2009-04-06 22:02:29 Re: INSERT or UPDATE
Previous Message Dann Corbit 2009-04-06 21:15:58 Re: INSERT or UPDATE