Search Postgresql Archives

Re: In a view, how do I cause fields with possible NULLs to be treated as a blank string in a replace operation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 27, 2011 at 5:58 PM, Thom Brown <thom@xxxxxxxxx> wrote:
>
> Try coalesce: http://www.postgresql.org/docs/9.0/static/functions-conditional.html#AEN15541
>
> So if foo is a null value, and you used COALESCE(foo, 'bar'), the
> output would be 'bar', otherwise it would be whatever the value of foo
> is.
>


On Mon, Jun 27, 2011 at 5:59 PM, Rick Genter <rick.genter@xxxxxxxxx> wrote:
> Either use '' as some_type, or use COALESCE(some_type, '').
>


Thank you both, that worked fine.

-- 
Regards,
     Asfand Qazi
     Team 87 HTGT
     Wellcome Trust Sanger Institute

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux