Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 44965 invoked from network); 16 Nov 2004 10:25:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Nov 2004 10:25:05 -0000 Received: (qmail 88550 invoked by uid 500); 16 Nov 2004 10:25:03 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 88528 invoked by uid 500); 16 Nov 2004 10:25:02 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 88513 invoked by uid 99); 16 Nov 2004 10:25:02 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [145.253.175.227] (HELO smtp-gw2.pta.de) (145.253.175.227) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 16 Nov 2004 02:25:01 -0800 To: "Apache Torque Users List" From: arne.siegel@pta.de Subject: Antwort: Re: Subtracting fields in the Where Clause MIME-Version: 1.0 Date: Tue, 16 Nov 2004 11:24:58 +0100 Message-ID: X-MIMETrack: Serialize by Router on MA_NOTES3/PTA_GL/De(Release 5.0.13a |April 8, 2004) at 11/16/2004 11:25:01 AM Content-type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, you should consider defining a db view returning the computed value to_days(s.end_of_subscription_date) - to_days(SYSDATE()) as expiration_days. You could then simplify your query to look like this: SELECT user_id FROM details d, view_subscribers v WHERE v.app_id = d.app_id AND v.expiration_days = d.end_warning which is easy to transform to torque queries. Hope this helps Arne ********************************************************************** http://www.pta.de Mit 1051 Erfahrungsberichten aus 35 Jahren erfolgreicher Projektarbeit! ********************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org