avatar
e*o
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
avatar
g*o
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

avatar
c*d
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?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。