RE: Subselects in Torque 3.3rc2

"Manaster, Carl" <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <[email protected]>
Hi, Markus,

> Now I managed this with two criteria.addJoin();
>
> Is there a better way?

I think treating it as a regular, instead of a nested, query, makes lots
of sense (at the SQL level, independent of torque).  Just think of the
query as

select name [or perhaps DISTINCT name]
from       resource                r
inner join resource_postalcode_rel k on k.id [or perhaps k.RESOURCE_ID]
= r.id
inner join postalcode              p on p.id = k.postalcode_id
where p.city_name  like '%76%'
or    p.postalcode like '%76%'

To my eye, anyway, that's a good deal clearer than the nested selects.

Peace,
--Carl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.