|
-
Query Problem
The emp table contains these columns:
EmpName Varchar2 (25)
Salary Number7, 2
You need to display the names of employees on more than an average salary of all employees.
Why does this fail to work :
select EmpName,salary from emp having salary > avg(salary) group by empname,salary ;
I get output as : No rows selected
But when i use sub- query the o/p is perfect :
select EmpName,salary from emp where salary > (select avg(salary) from emp) ;
Why is it so? Please help me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|