db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: Structuring a query with torque - excluding rows from a join
Date Mon, 01 Dec 2003 22:04:49 GMT
Graham Leggett wrote:

> I would like to run a query like so:
>
> select * from tableA where tableA_id not in (select tableA_id from 
> tableB)
>
> to give me the rows in tableA that are not referenced in tableB.
>
> How would I do this using torque?

Criteria does not support subqueries so you would either need to code 
the sql manually and use BasePeer.executeQuery() (and retrieve the data 
from the Village Records) or run two queries, one to select tableA_id 
from tableB and another that uses the result of the first query with NOT_IN.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au





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