how can i write torque Group By Query

Sasikumar Natarajan <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <[email protected]>
Hi All
 
The following query i need to change by using torque query.
 
SELECT DEPT_NUMBER, DEPT_NAME, COUNT(DEPT_NUMBER) NUMBER_OF_EMPLOYEES FROM EMPLOYEES EMP, DEPARTMENTS DEPT
WHERE EMP.EMP_DEPT_NUMBER = DEPT.DEPT_NUMBER GROUP BY DEPT_NUMBER, DEPT_NAME 
 
i did the following by using torque query. but this is wrong. 
 
Please help me to correct the following query.
 
Criteria criteria = new Criteria();
criteria.addSelectColumn(DepartmentPeer.DEPT_NUMBER);
criteria.addSelectColumn(DepartmentPeer.DEPT_NAME);

criteria.addGroupByColumn(DepartmentPeer.DEPT_NUMBER);
criteria.addGroupByColumn(DepartmentPeer.DEPT_NAME);

criteria.addJoin(EmployeePeer.EMP_DEPT_NUMBER, DepartmentPeer.DEPT_NUMBER);
List deptList = DepartmentPeer.doSelect(criteria);
 
Thanks in Advance
Sasikumar


      Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.