Albert :
There is no direct way to execute this query in CMP.
Only workaround is
use finder method. findAll()
find all the shop ID
Corresponding to each shop id,  get an enumeration by using a finder method
findTotal(shop id)  implement this method
Now corresponding to each shop id u have total
compute total by adding them for each shop id.
This is very absurd way, but this is the only way in case of CMP
otherwise use BMP.

Hope this solves ur problem

Anil


-----Original Message-----
From: Albert Chow [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 03, 2001 10:48 AM
To: [EMAIL PROTECTED]
Subject: Group by function


Hi,

        In CMP how can I get the same result as of the following SQL
statment :-

        select sum(total) from tableA group by shop_id;

        Thanx in advance.

Albert

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to