db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Dovlecel" <alexandru.dovle...@siemens.com>
Subject Calculated values
Date Fri, 09 Apr 2004 06:55:27 GMT

I have a table X connected with a toMany relation to an XHistory table. How
can I obtain the first and the last XHistory.changeDate field for each X in
my select? This would be equivalent with getting the "creation date" and
"last changed date".

I want to select all X that belongs to user with ID = 10, and also to
include those two history entries for each X (the first history and the last

In plain sql would be (I think...)
initdate as MIN( XHistory.dateOfChange ) , chgDate as MAX(
XHistory.dateOfChange ) GROUP BY X.id .

How to do this in Torque???

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message