Search Postgresql Archives

Re: Replace null values

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

 



On Tue, Mar 23, 2010 at 5:33 PM, Nilesh Govindarajan <lists@xxxxxxxxxx> wrote:
> On 03/23/2010 11:47 AM, John R Pierce wrote:
>>
>>> How to convert zero length string to null ?
>>
>>
>>
>> UPDATE yourtable SET name=NULL WHERE name='';
>>
>>
>
> No I don't want to replace it in the table. Just in the query result.
use a CASE construct.
select case name='' then null else name end from table where ......

Ian

-- 
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