Is there a translation problem in EJBQL with the DISTINCT construct and MSSQL? I have a query:
SELECT DISTINCT OBJECT(a) FROM Account a LEFT JOIN a.lastAccountActivity laa JOIN a.territory t JOIN t.collectors c JOIN c.team tm JOIN tm.supervisors s WHERE s.employee.username = :username ORDER BY laa.time ASC, a.accountNumber
Preparing the statement failed: ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
Update:
I'm now using EJB3 RC 9 patch 1 and the error still exists. Has anyone come across this problem before?