Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aDxuV-0004Ex-II for pgsql-php@arkaria.postgresql.org; Tue, 29 Dec 2015 17:18:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aDxuU-0002C3-Il for pgsql-php@arkaria.postgresql.org; Tue, 29 Dec 2015 17:18:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aDxuT-0002Bu-0r for pgsql-php@postgresql.org; Tue, 29 Dec 2015 17:18:09 +0000 Received: from teladesign.vm.bytemark.co.uk ([89.16.172.204]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aDxuO-00024W-W4 for pgsql-php@postgresql.org; Tue, 29 Dec 2015 17:18:07 +0000 Received: from [109.76.177.57] (helo=[127.0.0.1]) by teladesign.vm.bytemark.co.uk with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aDxuM-00038h-5e; Tue, 29 Dec 2015 17:18:02 +0000 Reply-To: rod@iol.ie Subject: Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql References: <5682B63E.9030008@iol.ie> <5682BBF3.1020605@iol.ie> To: Killian Driscoll , PostgreSQLPHP From: Raymond O'Donnell Message-ID: <5682C041.40706@iol.ie> Date: Tue, 29 Dec 2015 17:17:53 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-php Precedence: bulk Sender: pgsql-php-owner@postgresql.org On 29/12/2015 17:08, Killian Driscoll wrote: > While I fix getting kicked off the list I'll reply directly to you if > that's OK! No hassle. > Not sure - the php generator I am using states that to create a filter > condition: > "Filter condition allows you to reduce the list of values represented in > the lookup editor with a specified criterion. This condition corresponds > to the WHERE clause applied to the data source (you must not add the > WHERE keyword to beginning of the condition)." > > So, I need a WHERE condition based on my tables. How about moving the join into a subquery using EXISTS? - like this: [where] exists ( select 1 from country_table ct inner join lookup_table lt on (ct.country_type_id = lt.country_type_id) ) Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie -- Sent via pgsql-php mailing list (pgsql-php@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-php