Re: quering NULL values

Поиск
Список
Период
Сортировка
От Charley Tiggs
Тема Re: quering NULL values
Дата
Msg-id 43DE34FE.6040609@xpressdocs.com
обсуждение исходный текст
Ответ на quering NULL values  ("Luis Silva" <lfs12@hotmail.com>)
Ответы Re: quering NULL values  ("Luis Silva" <lfs12@hotmail.com>)
substring result  ("Luis Silva" <lfs12@hotmail.com>)
Re: quering NULL values  ("Luis Silva" <lfs12@hotmail.com>)
Список pgsql-novice
Luis Silva wrote:
> I there I'm having a problem.
>
> I'm doing this SQL query
>
> select count(*) from public_identif INNER JOIN ifc ON
> ifc.spid=public_identif.spid where (ifc.profilepartindicator='' OR
> ifc.profilepartindicator='UNREGISTERED') AND
> public_identif.identity='sip:joao@ptinovacao.pt'
>
>
> ifc.profilepartindicator=''  can be a NULL value that is why i'm doing
> this, but it's not working. I tried ifc.profilepartindicator=NULL but i
> get nothing again. Can you help please?? Tks a lot


change your query as follows:

select count(*) from public_identif INNER JOIN ifc ON
ifc.spid=public_identif.spid where (ifc.profilepartindicator='' OR
ifc.profilepartindicator IS NULL OR
ifc.profilepartindicator='UNREGISTERED') AND
public_identif.identity='sip:joao@ptinovacao.pt'

Note the addition of "ifc.profilepartindicator IS NULL" within the
parentheses.

Charley

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Help, 400 million rows, query slow, I stopped after 5 days
Следующее
От: "Christian Hofmann"
Дата:
Сообщение: Re: Help, 400 million rows, query slow, I stopped after 5 days