You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Alexandru Dovlecel <al...@siemens.com> on 2004/04/09 08:55:27 UTC

Calculated values

Hi,

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
history).

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???
Alex


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