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 are the types of join and explain each?
What is sql profiler in oracle?
What is the usage of sql functions?
what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba
What are stuff and replace function?
What is pl sql code?
What is the use of function in sql?
Is coalesce faster than isnull?
What is the usage of when clause in trigger?
Is ms sql traffic encrypted?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
What is sqlcontext?
what is user defined functions? : Sql dba
What are the benefits of triggers?
what are numeric data types? : Sql dba