Re: [SQL] simple SQL query

2008-10-29 Thread Andreas Joseph Krogh
On Wednesday 29 October 2008 18:39:42 Kevin Duffy wrote: Hello: I have a couple of queries that are giving me headaches. They are actually very simple, but I do not understand why I am not getting the expected results. Maybe I need new glasses. Please be kind. The table

Re: [SQL] simple SQL query

2008-10-29 Thread Kevin Duffy
the NULL ISINs in Security is causing so much grief? I do not get it. KD -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Joseph Krogh Sent: Wednesday, October 29, 2008 3:58 PM To: pgsql-sql@postgresql.org Subject: Re: [SQL] simple SQL query

Re: [SQL] simple SQL query

2008-10-29 Thread Andreas Joseph Krogh
On Wednesday 29 October 2008 21:56:14 Kevin Duffy wrote: Gentlemen: Thanks so much for your assistance. This returns 512 rows. select * from tmp_index_member tim where tim.ISIN NOT IN (select ISIN from security sec where ISIN is NOT NULL and securitytypekey IS NOT

Re: [SQL] simple SQL query

2008-10-29 Thread Tom Lane
Kevin Duffy [EMAIL PROTECTED] writes: Can someone explain why the NULL ISINs in Security is causing so much grief? I do not get it. NULL generally is taken as unknown in SQL comparisons. So if you have any nulls in the output of the sub-select, what the upper select sees is a situation like