Re: quering NULL values

From: "Luis Silva" <lfs12(at)hotmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: quering NULL values
Date: 2006-01-30 15:55:55
Message-ID: BAY18-F225527EF47057A4F427FFAB5090@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

>From: Charley Tiggs <ctiggs(at)xpressdocs(dot)com>
>To: Luis Silva <lfs12(at)hotmail(dot)com>
>CC: pgsql-novice(at)postgresql(dot)org
>Subject: Re: [NOVICE] quering NULL values
>Date: Mon, 30 Jan 2006 09:47:10 -0600
>
>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(at)ptinovacao(dot)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(at)ptinovacao(dot)pt'
>
>Note the addition of "ifc.profilepartindicator IS NULL" within the
>parentheses.
>
>Charley
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: explain analyze is your friend

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-01-30 16:28:44 Re: Help, 400 million rows, query slow, I stopped after 5 days
Previous Message Christian Hofmann 2006-01-30 15:54:22 Re: Help, 400 million rows, query slow, I stopped after 5 days