From torque-user-return-6216-apmail-db-torque-user-archive=db.apache.org@db.apache.org Fri Jun 17 14:26:21 2005 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 71515 invoked from network); 17 Jun 2005 14:26:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jun 2005 14:26:21 -0000 Received: (qmail 20659 invoked by uid 500); 17 Jun 2005 14:26:19 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 20633 invoked by uid 500); 17 Jun 2005 14:26:18 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 20620 invoked by uid 99); 17 Jun 2005 14:26:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from zeus.di.uoa.gr (HELO zeus.di.uoa.gr) (195.134.65.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2005 07:26:17 -0700 Received: from kronos.di.uoa.gr (root@kronos.di.uoa.gr [195.134.65.119]) by zeus.di.uoa.gr (8.12.10/8.12.10) with ESMTP id j5HEQFE3007643 for ; Fri, 17 Jun 2005 17:26:15 +0300 (EEST) Received: from [127.0.0.1] (sultana.di.uoa.gr [195.134.67.75]) by kronos.di.uoa.gr (8.12.10/8.12.10) with ESMTP id j5HEPtaA012515 for ; Fri, 17 Jun 2005 17:25:59 +0300 (EEST) Message-ID: <42B2DD71.1000004@di.uoa.gr> Date: Fri, 17 Jun 2005 17:25:53 +0300 From: =?ISO-8859-7?Q?=C1=ED=F4=FE=ED=E7=F2_=CB=E5=EC=F0=DD=F3=E7=F2?= User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: query with "exists" clause Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello, I have these two tables: doc(id, title) and rel(source, target) (both 'source' and 'target' are foreign keys to doc.id) I want to form the following query, using Criteria: SELECT d1.title FROM doc d1 WHERE EXISTS ( SELECT * FROM doc d2, rel r WHERE r.source = d1.id AND r.target = d2.id AND d2.title = 'foo') Any ideas on how to do this??? Thanks, Antonis --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org