Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by hub.org (8.10.1/8.11.0) with ESMTP id e9QHtdU00910 for ; Thu, 26 Oct 2000 13:55:40 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [206.169.43.130] (HELO agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.3) with ESMTP id 1113002 for pgsql-sql@postgresql.org; Thu, 26 Oct 2000 10:55:37 -0700 Message-ID: <39F86FFA.A1499290@agliodbs.com> Date: Thu, 26 Oct 2000 10:55:06 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions X-Mailer: Mozilla 4.73 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: sqllist Subject: Re: Query Problem References: <7F124BC48D56D411812500D0B74725140614B4@fileserver002.intecsystems.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/247 X-Sequence-Number: 1914 Michael, > SELECT Data > FROM Table A > WHERE NOT EXISTS ( > SELECT * FROM Table_B, Table_C > WHERE Table_B.GroupID = TableC.GroupID > AND TableC.AccountID = 11 > ) > > I think that the not exists is a bit quicker than the NOT IN. Give it > a whirl. A *lot* faster. Like, 7x as fast. I'd forgotten about EXISTS, since I so seldom have a use for it ... but this is shy it was created, I guess. Thanks so much for your help! -Josh Berkus -- ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 436-9166 for law firms, small businesses fax 436-0137 and non-profit organizations. pager 338-4078 San Francisco