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 Thomas Fischer <fi...@seitenbau.net> on 2007/08/01 12:51:01 UTC

RE: subqueries in criteria

Hi,

here is an example from one of the test classes for creating a subquery:

Criteria subquery = new Criteria();
subquery.addSelectColumn(AuthorPeer.AUTHOR_ID);
subquery.add(AuthorPeer.NAME, author2.getName());
Criteria criteria = new Criteria();
criteria.add(AuthorPeer.AUTHOR_ID, subquery, Criteria.IN);

List result = AuthorPeer.doSelect(criteria);

   Hope this helps,

         Thomas

"Neelima Yadla" <Ne...@CBC-Companies.com> schrieb am 27.07.2007
16:31:43:

> Hi,
>
>
>
> How to write criteria for the following sql,
>
>
>
> select count (*) from (select first, max (second), third
>
> from testtable
>
> group by first, third
>
>
>
> Thanks,
>
> Neelima
>
>
>
>
>


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