Unix Technical Forum

Re: Problem with NOT IN and Sub-Select

This is a discussion on Re: Problem with NOT IN and Sub-Select within the Pgsql General forums, part of the PostgreSQL category; --> 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, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 07:10 PM
Richard Huxton
 
Posts: n/a
Default Re: Problem with NOT IN and Sub-Select

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com