Search Postgresql Archives

Re: Problem with NOT IN and Sub-Select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mike wrote:
I have the following query

SELECT vw_mail_add.contact_id, vw_mail_add.first_name,
vw_mail_add.last_name, vw_mail_add.address1, vw_mail_add.add2,
vw_mail_add.add3, vw_mail_add.add4, vw_mail_add.add5, vw_mail_add.add6
FROM vw_mail_add JOIN tb_contact_role ON vw_mail_add.contact_id =
tb_contact_role.contact_id WHERE tb_contact_role.type2 = 72 AND
tb_contact_role.contact_id NOT IN ( SELECT contact_id FROM
tb_contact_role WHERE  type2 <> 72);

Don't suppose that subselect could return any NULLs could it?

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux