hi,

i've got the following tables:

test:
=====
t_id    primary key
...

module:
=======
m_id    primary key
...

rel_test_module:
================
rtm_id             primary key
rtm_rel_test_id    foreign key from test
rtm_rel_module_id  foreign key from module
...

Now I want to get all modules which are not part of test 2, which I
would express in SQL with a left join like this:

-----------------------cut------------------------------
SELECT 
        bs_module.* 
FROM 
        bs_module 
LEFT JOIN bs_rel_test_module ON         bs_rel_test_module.rtm_rel_module_id =
bs_module.m_id 
AND     bs_rel_test_module.rtm_rel_test_id = 2 
AND     bs_rel_test_module.rtm_delmark = 0 
WHERE 
        bs_rel_test_module.rtm_rel_module_id IS NULL 
AND     bs_module.m_delmark = 0;
-----------------------cut------------------------------

How can I do such things in Torque? Is it possible at all, or do I have
to break it up in steps:

1) Fetching all modules_ids from rel_test_module for test_id 2
2) Selecting all modules NOT IN modules_id from step 1

I took a look at Criteria but I haven't found I was looking for.

Thanks

tom

-- 
b e s t s o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
Thomas Schindl            Project Management   mobile ++43/664/314 59 58
------------------------------------------------------------------------
Anton-Rauch-Str.6a        A-6020 Innsbruck     fax       ++43/512/935834
http://www.bestsolution.at                     phone     ++43/512/935834

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to