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
Can a foreign key have a different name?
How do I remove duplicates in two columns?
Explain cursor types?
how can we submit a form without a submit button? : Sql dba
How many tables can a sql database have?
What are the different sql languages?
Give the order of sql select?
Advantages and disadvantages of stored procedure?
Can we call a function containing dml statements in a select query?
What is procedure in pl sql?
What is cascade in sql?
How do I create a memory optimized filegroup?
What is the purpose of the partition table?
What can you do with pl sql?
Is sql a oracle?