Re: Replace null values

Поиск
Список
Период
Сортировка
От Ian Haywood
Тема Re: Replace null values
Дата
Msg-id e79877201003222345u783253bcq510504745e9b3b9d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Replace null values  (Nilesh Govindarajan <lists@itech7.com>)
Список pgsql-general
On Tue, Mar 23, 2010 at 5:33 PM, Nilesh Govindarajan <lists@itech7.com> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Nilesh Govindarajan
Дата:
Сообщение: Re: Replace null values
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: pgreplay log file replayer released