org.postgresql.util.PSQLException: ERROR: column “xxx.id” must appear in the GROUP BY clause or be used in an aggregate function
错误**:列“XXXX.id”必须出现在GROUP BY子句中或在聚合函数中使用**
出现这种错误的sql如下:
select name,count(name) from person;
但是在MySQL数据库中使用不会报错,在其他数据库服务器中可能会出现错误,可以改为:
select name,count(name) from person group by name;
or
select count(name) from person;