db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arne.sie...@pta.de
Subject Antwort: Re: Subtracting fields in the Where Clause
Date Tue, 16 Nov 2004 10:24:58 GMT

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


Mime
View raw message