query to retrive the employees whose sal is greater than avg
sal

Answer Posted / viren

since we are using aggregate function AVG, we have to use
GROUP BY, HAVING clause.

select empName, avg(sal) from employees group by sal having
sal > avg(sal) order by empName;

Is This Answer Correct ?    4 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the advantages of sql ? : Sql dba

640


Why is stored procedure faster than query?

581


What are the differences between in and exists clause?

674


define sql update statement ? : Sql dba

689


What is number function in sql?

612






How does join work in sql?

654


What does 0 mean in sql?

614


Can we use ddl statements in stored procedure sql server?

609


What are different types of tables in sql?

607


how to use in conditions? : Sql dba

603


What is pl sql block in dbms?

607


What is the difference between left outer join and left join?

603


How can a pl sql block be executed?

617


Explain the difference between 'between' & 'and' operators in sql

624


What is the starting oracle error number?

646