db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robles, Rogelio" <Rogelio.Rob...@experian.com>
Subject How to do nested queries using the criteria API?
Date Mon, 14 Jun 2004 17:28:14 GMT
I need to do a query like this:

SELECT ...
FROM 
	( 
	  // find the MAX B.colX number of each group of A.colA + A.colB
	  //
	  SELECT A.colA as A, A.colB as B, MAX(B.colX) as X
        FROM A, B
        GROUP BY A.colA, A.colB
        WHERE A.colA = B.colA AND A.colB = B.colB
       ) as tmpTable, otherTable 
WHERE tmpTable.B = otherTable.B and tmpTable.X > otherTable.aLimit

And I need to do this because that's what
org.apache.torque.util.LargeSelect() is expecting as an input parameter, a
Criteria object, though, it will be good to create a LargeSelect()
constructor that accepts free form queries, or at least using the
com.workingdogs.village.QueryDataSet(), 
what you guys have done in a situation like this? 

Rogelio

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