Hi,
Since a transfer my databse from MySql to PostGreSql, i have a bug when executing this query in HQL :
Code:
from table1 table WHERE table.IdInstitution=2 GROUP BY table.institutionAddress
i have this exception :
Quote:
Caused by: org.postgresql.util.PSQLException: ERROR: column "table0_.lang1" must appear in the GROUP BY clause or be used in an aggregate function
I have looked for solutions on web and GROUP BY doesn't seem to work with PostGreSql ...
Ok, but i want to group my institution by addresses. In fact, i have several institutions and each institution can have multiple addresses. And i just want to show each institution with different adress :
idInstitution |Address | city
2 |address1| Paris
2 |address2|New York
3 |address3|Los Angeles
I think solution must be found by using DISTINCT.
But with the previous code, i was able to work with objects table, and i want to. How to di this by using DISTINCT ??
Thank you for your help and sorry for my bad english ...