db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: subqueries in criteria
Date Wed, 01 Aug 2007 10:51:01 GMT
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" <Neelima.Yadla@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


Mime
View raw message