Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 17359 invoked from network); 8 Nov 2007 18:19:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2007 18:19:33 -0000 Received: (qmail 24070 invoked by uid 500); 8 Nov 2007 18:19:17 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 24046 invoked by uid 500); 8 Nov 2007 18:19:17 -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 24029 invoked by uid 99); 8 Nov 2007 18:19:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 10:19:17 -0800 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 32.97.182.142 is neither permitted nor denied by domain of Stan.Bradbury@gmail.com) Received: from [32.97.182.142] (HELO e2.ny.us.ibm.com) (32.97.182.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 18:19:18 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id lA8IIt72003059 for ; Thu, 8 Nov 2007 13:18:55 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id lA8IIjWc082560 for ; Thu, 8 Nov 2007 13:18:55 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lA8IIjgl015129 for ; Thu, 8 Nov 2007 13:18:45 -0500 Received: from [127.0.0.1] (bradbury-lt07.usca.ibm.com [9.72.133.61]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lA8IIiN0015034 for ; Thu, 8 Nov 2007 13:18:45 -0500 Message-ID: <47335306.7000503@gmail.com> Date: Thu, 08 Nov 2007 10:18:46 -0800 From: Stanley Bradbury User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Derby Discussion Subject: Re: Quering on multiple rows References: <13651100.post@talk.nabble.com> <47334B6B.3010000@gmail.com> <13652328.post@talk.nabble.com> In-Reply-To: <13652328.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I was confused by you use of 'constraint' - I was thinking of data integrity constraints implemented by foreign keys or UNIQUE or NOT NULL. I think Kristian pointed you in the right direction, use one of the basic or qualified predicates to retrieve the records you wish. Patrick Sp. wrote: > Hi Stanley, > > Thank you for your response. > This is what is actually done. My question is rather about the SQL statement > I need to execute in order to be able to express constraints on multiple > rows on the Mission table related to one specific employee. > Any help is appreciated. > Thanks > P. > > --- > In many ways this is a matter of preference but, IMHO, since both > Missions and Employee seem to be primary objects and there could be a > M:M relationship I would create an association table with two columns > Mission_id and Employee_id and, for good form, throw in a > auto-increment column to be used as the primary key of the table (or the > compound key Mission_id and Employee_id could be used as the PK). > > > >