Interpretation of ORA-00979 not a group by expression Error

Source: Internet
Author: User

The ORA-00979 is not an explanation of the group by expression error ORA-00979 is not a group by expression. "This error, like the other wrong ORA-00937 I introduced earlier, makes a lot of oracle beginners love to commit. When I introduced the use of group by in aggregate functions to group data, I specifically stated that columns that do not exist in the select list item can appear in the group by list item, but in turn they won't work, all columns in the select list items must be behind group by (except for Aggregate functions). However, some friends often forget to write the columns in the select list items in group. So the above error occurs. The ORA-00979 is not a group by expression. Oracle's Chinese error message translation is very inadequate. Many friends are confused about the group by expression and do not know what oracle is saying. For example, in the following example, this error occurs: SQL> select deptno, job, avg (sal) 2 from emp 3 group by deptno; select deptno, job, avg (sal) * ERROR lies in row 1st: ORA-00979: Not a group by expression. This is because deptno and job appear in the select list, but not in group. The preceding errors are corrected as follows: Select deptno, job, avg (sal) from emp Group by deptno, job;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.