i have a table
eno dno sal
1 10 200
2 10 150
3 10 100
4 20 75
5 20 100
i want to get sal which is less than the avg sal of thri dept.
eno dno sal
2 10 150
3 10 100
4 20 75
Answer Posted / praveen
select * from emp e where sal<
(select avg(sal) from emp where deptno=e.deptno)
order by deptno
| Is This Answer Correct ? | 20 Yes | 2 No |
Post New Answer View All Answers
what is union, minus and interact commands? : Sql dba
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
Enlist the advantages of sql.
What does bitemporal mean?
What are the types of variable use in pl sql?
How to add new employee details in an employee_details table with the following details
Can function return multiple values in sql?
What is a recursive stored procedure?
how to concatenate two character strings? : Sql dba
Explain how exception handling is done in advance pl/sql?
What are different categories of sql commands?
Does oracle roll back the transaction on an error?
I need a function for a train ticket reservation please answer it thanks in advance
What is the usage of when clause in trigger?
What are the key differences between SQL and PL SQL?