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 / abhishekjaiswal
select department_id,salary from employees e
where salary<(select trunc(avg(salary))
from employees where department_id=e.department_id;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how to convert numeric values to character strings? : Sql dba
Can a select statement fire a trigger?
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.
How can a pl sql block be executed?
What are analytic functions in sql?
how to check myisam tables for errors? : Sql dba
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?
what is sub-query? : Transact sql
what are ddl statements in mysql? : Sql dba
What is asqueryable?
How to display Row Number with Records in Oracle SQL Plus?
In what condition is it good to disable a trigger?
Write the command to remove all players named sachin from the players table.
What is the least restrictive isolation level? : Transact sql
How do I find duplicates in sql?