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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to