Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

SQL group by

Darshan D BFeb 21 2024

I need to display employees details whose salary is greater than average salary of their department. below is table

Table:

I know that we can easily find the solution using subquery and other methods but I need to know why below group by solution not working.

Solution 1) This solution is giving correct result, when I only join ON dept_name

solution 2 ) Below code is giving wrong result when I add extra condition with emp_id.

This post has been answered by Cookiemonster76 on Feb 21 2024
Jump to Answer
Comments
Post Details
Added on Feb 21 2024
4 comments
99 views