Received: from jennifer.emc.com.ph (una-gateway.emc.com.ph [208.232.224.254]) by hub.org (8.10.1/8.10.1) with ESMTP id e6R2eWA15012 for ; Wed, 26 Jul 2000 22:40:52 -0400 (EDT) Received: from fc.emc.com.ph (emc-fc.emc.com.ph [203.176.3.197]) by jennifer.emc.com.ph (Postfix) with ESMTP id 895D9D7E9; Thu, 27 Jul 2000 10:40:04 +0800 (PST) Message-id: Date: Thu, 27 Jul 2000 10:40:04 +0800 Subject: Re(2): optimize sql To: pgsql-sql@postgresql.org, reedstrm@rice.edu From: pgsql-sql@fc.emc.com.ph (pgsql-sql) MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200007/247 reedstrm@rice.edu writes: >How does the output of the above differ from: > >SELECT name FROM office, office_application >WHERE code = office_code >AND active != 't'; > >Without knowing the table structures (which tables to active, code, >and office_code belong to?) it's hard to suggest much else. > >Ross The name and code fields belong to office table. While office_code and active fields belong to office_application table. The name field have duplicates and among the duplicates, only one active field is TRUE. I just wanted to get name field that has no TRUE active field. Any other idea? Thanks. sherwin