| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | mike <mike(at)redtux1(dot)uklinux(dot)net> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Problem with NOT IN and Sub-Select |
| Date: | 2005-01-26 15:27:27 |
| Message-ID: | 41F7B6DF.7090300@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Lonni J Friedman | 2005-01-26 15:30:54 | Re: how come I get this error message when I try to connect to Postgresql |
| Previous Message | Richard Huxton | 2005-01-26 15:26:56 | Re: how come I get this error message when I try to connect |