X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A2E1FD7E07 for ; Sun, 13 Nov 2005 13:13:44 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41736-04 for ; Sun, 13 Nov 2005 17:13:43 +0000 (GMT) X-Greylist: delayed 00:06:40.077116 by SQLgrey- Received: from web54314.mail.yahoo.com (web54314.mail.yahoo.com [206.190.49.124]) by svr1.postgresql.org (Postfix) with SMTP id BCFC3D715A for ; Sun, 13 Nov 2005 13:13:42 -0400 (AST) Received: (qmail 47849 invoked by uid 60001); 13 Nov 2005 17:07:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=fiFyba4pWAcA02w4ZeU5AJf/R83Q8Gz1G4xa6Dayuemfy/L8JKic6RkjbKFYjE/SUTptMlBjScu7MMA6Nmgt39ATQAkKHgVIyR3NfHqrROnQ2N/OcHV97A4vcG1ZBKNqXGAcFs1q4G8t96f4AJgyap886vc6EvCyGqct1Z81RIU= ; Message-ID: <20051113170701.47847.qmail@web54314.mail.yahoo.com> Received: from [69.20.170.211] by web54314.mail.yahoo.com via HTTP; Sun, 13 Nov 2005 09:07:01 PST Date: Sun, 13 Nov 2005 09:07:01 -0800 (PST) From: chester c young Subject: Re: Problem with "NOT IN (subquery) - use NOT EXISTS To: Steve SAUTETNER , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200511/112 X-Sequence-Number: 23363 --- Steve SAUTETNER wrote: > SELECT * FROM famille WHERE famille_code NOT IN > (SELECT DISTINCT famille_mere_famille_code FROM famille);" try select * from famille f1 where not exists (select 1 from famille f2 where f1.famille_code = f2.famille_mere_famille_code); __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com