Hi,
I have a very simple OM comprised only of the Transaction class with fields: merchantId, cardId, country, amount.
I want to create a criteria for selecting all Transactions for the cardIds that were used more than 5 times with the same merchantId.
The SQL select looks something like this:
Code:
select t2.* from (
select * from SYSTEM.TBL_TRANSACTIONS) t2
JOIN (
select MERCHANTID, CARDID, Count(CARDID) as nbTxns
from SYSTEM.TBL_TRANSACTIONS GROUP BY MERCHANTID, CARDID) t1 on t2.CARDID = t1.CARDID AND t2.MERCHANTID=t1.MERCHANTID WHERE (nbTxns > 5);
Is there any way to accomplish this using the Criteria language?
Thx.