Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WV5jc-0003sS-Au for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2014 20:56:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WV5jb-0007nT-OD for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2014 20:56:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WV5ja-0007nL-Nk for pgsql-general@postgresql.org; Tue, 01 Apr 2014 20:56:38 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WV5jY-0000Hc-DU for pgsql-general@postgresql.org; Tue, 01 Apr 2014 20:56:38 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id s31KuSe32021 for ; Tue, 1 Apr 2014 13:56:28 -0700 Message-ID: <533B27F7.4040608@hogranch.com> Date: Tue, 01 Apr 2014 13:56:23 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: SQL Question References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 4/1/2014 1:27 PM, Robert DiFalco wrote: > Heh, scratch that, the EXISTS query DOES work. Is this the most > efficient way to perform this kind of query? Thanks! I would try and express that as a left outer join, and use (c2.owner_id IS NOT NULL) as your boolean field (or something like that) -- john r pierce 37N 122W somewhere on the middle of the left coast -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general