Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 2344 invoked from network); 27 Jun 2008 15:06:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jun 2008 15:06:50 -0000 Received: (qmail 3482 invoked by uid 500); 27 Jun 2008 15:06:50 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 3447 invoked by uid 500); 27 Jun 2008 15:06:50 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 3436 invoked by uid 99); 27 Jun 2008 15:06:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2008 08:06:50 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2008 15:05:59 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KCFWk-0003sK-8e for derby-user@db.apache.org; Fri, 27 Jun 2008 08:06:18 -0700 Message-ID: <18157186.post@talk.nabble.com> Date: Fri, 27 Jun 2008 08:06:18 -0700 (PDT) From: Yun Chie To: derby-user@db.apache.org Subject: need help with distinct results MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: flavour12345@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I have the following statement (very roughly): SELECT DISTINCT Customer.Customer_UID, Sales.Sales_UID FROM Customers, Sales ... INTERSECT SELECT DISTINCT Customer.Customer_UID, Sales.Sales_UID FROM Customers, Sales ... I just need to know what's the right syntax to retrieve only the distinct results, as, the above statement retrieve also duplicates, in other words, what is in derby the right syntax for the following statement: SELECT Customer.Customer_UID, Sales.Sales_UID ( (SELECT DISTINCT Customer.Customer_UID, Sales.Sales_UID FROM Customers, Sales ...) INTERSECT (SELECT DISTINCT Customer.Customer_UID, Sales.Sales_UID FROM Customers, Sales ...) ) thanks for your help. -- View this message in context: http://www.nabble.com/need-help-with-distinct-results-tp18157186p18157186.html Sent from the Apache Derby Users mailing list archive at Nabble.com.