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/