本帖最后由 forever2u 于 2013-09-12 21:27:37 编辑

解决方案 »

  1.   

    select emp.ename, emp.sal ,dept.deptno from emp,dept where emp.deptno=dept.deptno group by dept.deptno
    如果你用到group by 语句 要查询的字段必须加聚合函数 比如
    select  sum(emp.sal) ,dept.deptno from emp,dept where emp.deptno=dept.deptno group by dept.deptno
      

  2.   

    Group by规则,出现在select列表中的字段,如果查询列没有出现主函数中,就必须出现在group by 列表中。