如下hql关联语句,想实现group by 去重:
querySentenceBuffer.append("FROM ComPerformance p,ComPerformancesub s,ComPerformanceval v,ComOrguserinfo u ");
querySentenceBuffer.append(" group by  p.comOrguser.useridNum");出现错误提示如下:
ORA-00937: not a single-group group function

解决方案 »

  1.   

    用的是oracle吗?把sql语句在控制台上打印出来,在plsql中运行下,看是不是sql语句的事
      

  2.   

    oracle中的group by 感觉是不是不如mysql中的好用,在oracle中 这样的sql语句是报错的:
    select a,b,c from table1 group by a;  这样是报错的,要这样才不报错:
    select a,b,c from table1 group by a,b,c;
    在mysql中select a,b,c from table1 group by a;这个就能运行,哎……
      

  3.   

    到plsql中打出来的提示:
    ORA-00979: not a GROUP BY expression
      

  4.   

    caolong0210说的非常对,感谢!结帖