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 / mahalakshmi s
select * from (select id,(case when sal < avg(sal) over(partition by id) then sal else 0 end) avg_val from dept) a where avg_val !=0;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do temporal tables work?
What is meant by user defined function?
What is the largest value that can be stored in a byte data field?
What are the rules to be applied to nulls whilst doing comparisons?
How do I trace sql profiler?
what are the type of locks ? : Sql dba
How do you create an update query?
what does the t-sql command ident_incr does? : Transact sql
what is the difference between truncate and delete statement? : Transact sql
What is a temporal data type?
How do I get sql certification?
Which is better trigger or stored procedure?
Where is pl sql used?
Which are sql * plus commands?
what is “go” in t-sql? : Transact sql