HomePrivacy PolicyFeedbackLink to usSite Map

Oracle/PLSQL: ORA-00924 Error


Error:

ORA-00924: missing BY keyword

Cause:

You tried to execute a GROUP BY, ORDER BY, CONNECT BY, or GRANT (with IDENTIFIED) statement and missed the BY keyword.

Action:

The options to resolve this Oracle error are:
  1. Try adding the missing BY keyword and re-execute the statement.

For example, if you tried to execute the following:

SELECT department, SUM(sales) as "Total sales"
FROM order_details
GROUP department;


You would receive the following error message:


You could correct this error with the following statement:

SELECT department, SUM(sales) as "Total sales"
FROM order_details
GROUP BY department;