Re: Need efficient way to do comparison with NULL as an option

Поиск
Список
Период
Сортировка
Искать
От
Lew
Тема
Re: Need efficient way to do comparison with NULL as an option
Дата
Msg-id
wK6dnSHN9r8AOuLanZ2dnUVZ_gqdnZ2d@comcast.com
Ответ на
Список
Дерево обсуждения
Need efficient way to do comparison with NULL as an option "D. Dante Lorenso" <dante@lorenso.com>
Re: Need efficient way to do comparison with NULL as an option Tom Lane <tgl@sss.pgh.pa.us>
Re: Need efficient way to do comparison with NULL as an option "D. Dante Lorenso" <dante@lorenso.com>
Re: Need efficient way to do comparison with NULL as an option Tom Lane <tgl@sss.pgh.pa.us>
Re: Need efficient way to do comparison with NULL as an option "Joshua D. Drake" <jd@commandprompt.com>
Re: Need efficient way to do comparison with NULL as an option Lew <lew@lwsc.ehost-services.com>
Re: Need efficient way to do comparison with NULL as an option "D. Dante Lorenso" <dante@lorenso.com>
Re: Need efficient way to do comparison with NULL as an option "D. Dante Lorenso" <dante@lorenso.com>
D. Dante Lorenso wrote:
>> But if I want to find all the items which are not in any folder, I want:
>>
>>   SELECT *
>>   FROM mytable
>>   WHERE folder_id IS NULL;
>>
>> I don't have any folder_id 0, so on a URL I might do this:
>>
>>   http://xyz/page.php?fid=123
>>   http://xyz/page.php?fid=0

SELECT * FROM mytable WHERE COALESCE( folder_id, 0 ) = 0;

-- 
Lew
В списке pgsql-general по дате отправления
От: cdecarlo
Дата:
От: O'Shea, Brendan
Дата:
FAQ