e**o 发帖数: 131 | 1 SELECT EMP.ENAME,EMP.DEPTNO,DEPT.DNAME FROM EMP,DEPT WHERE
EMP.DEPTNO=DEPT.DEPTNO GROUP BY EMP.DEPTNO ORDER BY EMP.ENAME
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression | g***o 发帖数: 297 | 2 you donot have aggregation function such as COUNT(), MIN(), AVG() in
your SELECT statement, how can you use group by function?
【在 e**o 的大作中提到】 : SELECT EMP.ENAME,EMP.DEPTNO,DEPT.DNAME FROM EMP,DEPT WHERE : EMP.DEPTNO=DEPT.DEPTNO GROUP BY EMP.DEPTNO ORDER BY EMP.ENAME : * : ERROR at line 1: : ORA-00979: not a GROUP BY expression
| c********d 发帖数: 4 | 3 yes. generally, all of the items in the select list must have a single value
for each group of rows. that is to say,
1. a constant
2. column function, i.e. aggregation funtion. the function will produces a
single value summarizing each group of rows.
3. grouping column (which has the same value in every row of the groups by
definition).
4. an expression involving all of the above (1, 2 and 3)
so in your case, germo is right. you have missed the aggregation function
obviously.
【在 g***o 的大作中提到】 : you donot have aggregation function such as COUNT(), MIN(), AVG() in : your SELECT statement, how can you use group by function?
|
|