Skip to content
Advertisement

About “group function is not allowed here”

I have a table with job, salary and date columns. I am writing the following query in PL/SQL, but I am getting an error

group function is not allowed here

How can I solve this problem?

Advertisement

Answer

Your query makes no sense (to me, at least). What does that average salary represent? Whose average salary?

Here’s an example based on Scott’s EMP table; I’m going to delete employees who were hired on 3th of December 1981 and work in department whose employees’ average salary is higher than 2000.

Sample data:

Averege salaries per department:

So: I’m looking for employees who work in department 20 (as only that department has average salaries higher than 2000) and who were hired on 03.12.1981 (James and Ford, but only Ford works in department 20):

Is Ford still in there?

Nope, deleted.


Now, your turn.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement